StarPU Handbook

starpu_thread.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2010-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 *
5 * StarPU is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or (at
8 * your option) any later version.
9 *
10 * StarPU is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15 */
16
17// The documentation for this file is in doc/doxygen/chapters/api/threads.doxy
18
19#ifndef __STARPU_THREAD_H__
20#define __STARPU_THREAD_H__
21
22#include <starpu_config.h>
23#include <starpu_util.h>
24#ifdef STARPU_SIMGRID
25#include <pthread.h>
26#ifdef STARPU_HAVE_SIMGRID_MUTEX_H
27#include <simgrid/mutex.h>
28#include <simgrid/cond.h>
29#elif defined(STARPU_HAVE_XBT_SYNCHRO_H)
30#include <xbt/synchro.h>
31#else
32#include <xbt/synchro_core.h>
33#endif
34#ifdef STARPU_HAVE_SIMGRID_ACTOR_H
35#include <simgrid/actor.h>
36#endif
37#ifdef STARPU_HAVE_SIMGRID_SEMAPHORE_H
38#include <simgrid/semaphore.h>
39#endif
40#ifdef STARPU_HAVE_SIMGRID_MUTEX_H
41#include <simgrid/mutex.h>
42#endif
43#ifdef STARPU_HAVE_SIMGRID_COND_H
44#include <simgrid/cond.h>
45#endif
46#ifdef STARPU_HAVE_SIMGRID_BARRIER_H
47#include <simgrid/barrier.h>
48#endif
49#ifdef STARPU_HAVE_SIMGRID_HOST_H
50#include <simgrid/host.h>
51#endif
52#ifdef STARPU_HAVE_SIMGRID_MSG_H
53#include <simgrid/msg.h>
54#elif defined(STARPU_HAVE_MSG_MSG_H)
55#include <msg/msg.h>
56#endif
57#elif !defined(_MSC_VER) || defined(BUILDING_STARPU)
58#include <pthread.h>
59#include <semaphore.h>
60#endif
61#include <stdint.h>
62
63#ifdef __cplusplus
64 extern "C"
65{
66#endif
67
68/*
69 * Encapsulation of the pthread_create function.
70 */
71
72#ifdef STARPU_SIMGRID
73
74#ifdef STARPU_HAVE_SIMGRID_ACTOR_H
75 typedef sg_actor_t starpu_pthread_t;
76#else
77 typedef msg_process_t starpu_pthread_t;
78#endif
79 typedef int starpu_pthread_attr_t;
80
81#ifdef STARPU_HAVE_SIMGRID_ACTOR_H
82 typedef sg_host_t starpu_sg_host_t;
83#else
84 typedef msg_host_t starpu_sg_host_t;
85#endif
86 int starpu_pthread_equal(starpu_pthread_t t1, starpu_pthread_t t2);
87starpu_pthread_t starpu_pthread_self(void);
88 int starpu_pthread_create_on(const char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg, starpu_sg_host_t host);
89 int starpu_pthread_create(starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
90starpu_pthread_t _starpu_simgrid_actor_create(const char *name, xbt_main_func_t code, starpu_sg_host_t host, int argc, char *argv[]);
91 int starpu_pthread_join(starpu_pthread_t thread, void **retval);
92 int starpu_pthread_exit(void *retval) STARPU_ATTRIBUTE_NORETURN;
93 int starpu_pthread_attr_init(starpu_pthread_attr_t *attr);
94 int starpu_pthread_attr_destroy(starpu_pthread_attr_t *attr);
95 int starpu_pthread_attr_setdetachstate(starpu_pthread_attr_t *attr, int detachstate);
96
97#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* STARPU_SIMGRID */
98
99 typedef pthread_t starpu_pthread_t;
100 typedef pthread_attr_t starpu_pthread_attr_t;
101
102#define starpu_pthread_equal pthread_equal
103#define starpu_pthread_self pthread_self
104#define starpu_pthread_create pthread_create
105#define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(thread, attr, routine, arg)
106#define starpu_pthread_join pthread_join
107#define starpu_pthread_exit pthread_exit
108#define starpu_pthread_attr_init pthread_attr_init
109#define starpu_pthread_attr_destroy pthread_attr_destroy
110#define starpu_pthread_attr_setdetachstate pthread_attr_setdetachstate
111
112#endif /* STARPU_SIMGRID, _MSC_VER */
113
114#ifdef STARPU_HAVE_PTHREAD_SETNAME_NP
115#ifdef STARPU_HAVE_DARWIN
116#define starpu_pthread_setname(name) pthread_setname_np(name)
117#else
118#define starpu_pthread_setname(name) pthread_setname_np(pthread_self(), name)
119#endif
120#else
121#define starpu_pthread_setname(name)
122#endif
123
124/*
125 * Encapsulation of the pthread_mutex_* functions.
126 */
127
128#ifdef STARPU_SIMGRID
129#ifdef STARPU_HAVE_SIMGRID_MUTEX_H
130 typedef sg_mutex_t starpu_pthread_mutex_t;
131#else
132 typedef xbt_mutex_t starpu_pthread_mutex_t;
133#endif
134 typedef int starpu_pthread_mutexattr_t;
135
136#define STARPU_PTHREAD_MUTEX_INITIALIZER NULL
137
138 int starpu_pthread_mutex_init(starpu_pthread_mutex_t *mutex, const starpu_pthread_mutexattr_t *mutexattr);
139 int starpu_pthread_mutex_destroy(starpu_pthread_mutex_t *mutex);
140 int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex);
141 int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex);
142 int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex);
143 int starpu_pthread_mutexattr_gettype(const starpu_pthread_mutexattr_t *attr, int *type);
144 int starpu_pthread_mutexattr_settype(starpu_pthread_mutexattr_t *attr, int type);
145 int starpu_pthread_mutexattr_destroy(starpu_pthread_mutexattr_t *attr);
146 int starpu_pthread_mutexattr_init(starpu_pthread_mutexattr_t *attr);
147
148#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* !STARPU_SIMGRID */
149
150 typedef pthread_mutex_t starpu_pthread_mutex_t;
151 typedef pthread_mutexattr_t starpu_pthread_mutexattr_t;
152
153#define starpu_pthread_mutex_init pthread_mutex_init
154#define starpu_pthread_mutex_destroy pthread_mutex_destroy
155#define starpu_pthread_mutexattr_gettype pthread_mutexattr_gettype
156#define starpu_pthread_mutexattr_settype pthread_mutexattr_settype
157#define starpu_pthread_mutexattr_destroy pthread_mutexattr_destroy
158#define starpu_pthread_mutexattr_init pthread_mutexattr_init
159
160#ifdef STARPU_FXT_LOCK_TRACES
161 int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex);
162 int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex);
163 int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex);
164#else
165#define starpu_pthread_mutex_lock pthread_mutex_lock
166#define starpu_pthread_mutex_unlock pthread_mutex_unlock
167#define starpu_pthread_mutex_trylock pthread_mutex_trylock
168#endif
169
170#define STARPU_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
171
172#endif /* STARPU_SIMGRID, _MSC_VER */
173
174#if !defined(_MSC_VER) || defined(BUILDING_STARPU)
175 int starpu_pthread_mutex_lock_sched(starpu_pthread_mutex_t *mutex);
176 int starpu_pthread_mutex_unlock_sched(starpu_pthread_mutex_t *mutex);
177 int starpu_pthread_mutex_trylock_sched(starpu_pthread_mutex_t *mutex);
178 void starpu_pthread_mutex_check_sched(starpu_pthread_mutex_t *mutex, char *file, int line);
179#endif
180
181/*
182 * Encapsulation of the pthread_key_* functions.
183 */
184#ifdef STARPU_SIMGRID
185
186 typedef int starpu_pthread_key_t;
187 int starpu_pthread_key_create(starpu_pthread_key_t *key, void (*destr_function) (void *));
188 int starpu_pthread_key_delete(starpu_pthread_key_t key);
189 int starpu_pthread_setspecific(starpu_pthread_key_t key, const void *pointer);
190 void *starpu_pthread_getspecific(starpu_pthread_key_t key);
191
192#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* !STARPU_SIMGRID */
193
194 typedef pthread_key_t starpu_pthread_key_t;
195
196#define starpu_pthread_key_create pthread_key_create
197#define starpu_pthread_key_delete pthread_key_delete
198#define starpu_pthread_setspecific pthread_setspecific
199#define starpu_pthread_getspecific pthread_getspecific
200
201#endif /* STARPU_SIMGRID, _MSC_VER */
202
203/*
204 * Encapsulation of the pthread_cond_* functions.
205 */
206
207#ifdef STARPU_SIMGRID
208
209#ifdef STARPU_HAVE_SIMGRID_COND_H
210 typedef sg_cond_t starpu_pthread_cond_t;
211#else
212 typedef xbt_cond_t starpu_pthread_cond_t;
213#endif
214 typedef int starpu_pthread_condattr_t;
215#define STARPU_PTHREAD_COND_INITIALIZER NULL
216
217 int starpu_pthread_cond_init(starpu_pthread_cond_t *cond, starpu_pthread_condattr_t *cond_attr);
218 int starpu_pthread_cond_signal(starpu_pthread_cond_t *cond);
219 int starpu_pthread_cond_broadcast(starpu_pthread_cond_t *cond);
220 int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex);
221 int starpu_pthread_cond_timedwait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex, const struct timespec *abstime);
222 int starpu_pthread_cond_destroy(starpu_pthread_cond_t *cond);
223
224#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* !STARPU_SIMGRID */
225
226 typedef pthread_cond_t starpu_pthread_cond_t;
227 typedef pthread_condattr_t starpu_pthread_condattr_t;
228#define STARPU_PTHREAD_COND_INITIALIZER PTHREAD_COND_INITIALIZER
229
230#define starpu_pthread_cond_init pthread_cond_init
231#define starpu_pthread_cond_signal pthread_cond_signal
232#define starpu_pthread_cond_broadcast pthread_cond_broadcast
233
234#ifdef STARPU_FXT_LOCK_TRACES
235 int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex);
236#else
237#define starpu_pthread_cond_wait pthread_cond_wait
238#endif
239
240#define starpu_pthread_cond_timedwait pthread_cond_timedwait
241#define starpu_pthread_cond_destroy pthread_cond_destroy
242
243#endif /* STARPU_SIMGRID, _MSC_VER */
244
245/*
246 * Encapsulation of the pthread_rwlock_* functions.
247 */
248
249#ifdef STARPU_SIMGRID
250
251#ifdef STARPU_HAVE_SIMGRID_MUTEX_H
252 typedef sg_mutex_t starpu_pthread_rwlock_t;
253#else
254 typedef xbt_mutex_t starpu_pthread_rwlock_t;
255#endif
256 typedef int starpu_pthread_rwlockattr_t;
257
258 int starpu_pthread_rwlock_init(starpu_pthread_rwlock_t *rwlock, const starpu_pthread_rwlockattr_t *attr);
259 int starpu_pthread_rwlock_destroy(starpu_pthread_rwlock_t *rwlock);
260 int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock);
261 int starpu_pthread_rwlock_tryrdlock(starpu_pthread_rwlock_t *rwlock);
262 int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock);
263 int starpu_pthread_rwlock_trywrlock(starpu_pthread_rwlock_t *rwlock);
264 int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock);
265
266#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* !STARPU_SIMGRID */
267
268 typedef pthread_rwlock_t starpu_pthread_rwlock_t;
269 typedef pthread_rwlockattr_t starpu_pthread_rwlockattr_t;
270
271#define starpu_pthread_rwlock_init pthread_rwlock_init
272#define starpu_pthread_rwlock_destroy pthread_rwlock_destroy
273
274#ifdef STARPU_FXT_LOCK_TRACES
275 int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock);
276 int starpu_pthread_rwlock_tryrdlock(starpu_pthread_rwlock_t *rwlock);
277 int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock);
278 int starpu_pthread_rwlock_trywrlock(starpu_pthread_rwlock_t *rwlock);
279 int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock);
280#else
281#define starpu_pthread_rwlock_rdlock pthread_rwlock_rdlock
282#define starpu_pthread_rwlock_tryrdlock pthread_rwlock_tryrdlock
283#define starpu_pthread_rwlock_wrlock pthread_rwlock_wrlock
284#define starpu_pthread_rwlock_trywrlock pthread_rwlock_trywrlock
285#define starpu_pthread_rwlock_unlock pthread_rwlock_unlock
286#endif
287
288#endif /* STARPU_SIMGRID, _MSC_VER */
289
290/*
291 * Encapsulation of the pthread_barrier_* functions.
292 */
293
294#if defined(STARPU_SIMGRID) || (!defined(STARPU_HAVE_PTHREAD_BARRIER) && (!defined(_MSC_VER) || defined(BUILDING_STARPU)))
295
296#if defined(STARPU_SIMGRID) && (defined(STARPU_HAVE_SIMGRID_BARRIER_H) || defined(STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT) || defined(xbt_barrier_init))
297#ifdef STARPU_HAVE_SIMGRID_BARRIER_H
298 typedef sg_bar_t starpu_pthread_barrier_t;
299#else
300 typedef xbt_bar_t starpu_pthread_barrier_t;
301#endif
302 typedef int starpu_pthread_barrierattr_t;
303#define STARPU_PTHREAD_BARRIER_SERIAL_THREAD -1
304#else
305 typedef struct {
306 starpu_pthread_mutex_t mutex;
307 starpu_pthread_cond_t cond;
308 starpu_pthread_cond_t cond_destroy;
309 unsigned count;
310 unsigned done;
311 unsigned busy;
312} starpu_pthread_barrier_t;
313 typedef int starpu_pthread_barrierattr_t;
314#define STARPU_PTHREAD_BARRIER_SERIAL_THREAD -1
315#endif
316
317 int starpu_pthread_barrier_init(starpu_pthread_barrier_t *barrier, const starpu_pthread_barrierattr_t *attr, unsigned count);
318 int starpu_pthread_barrier_destroy(starpu_pthread_barrier_t *barrier);
319 int starpu_pthread_barrier_wait(starpu_pthread_barrier_t *barrier);
320
321#elif !defined(_MSC_VER) /* STARPU_SIMGRID, !STARPU_HAVE_PTHREAD_BARRIER */
322
323 typedef pthread_barrier_t starpu_pthread_barrier_t;
324 typedef pthread_barrierattr_t starpu_pthread_barrierattr_t;
325
326#define starpu_pthread_barrier_init pthread_barrier_init
327#define starpu_pthread_barrier_destroy pthread_barrier_destroy
328
329#ifdef STARPU_FXT_LOCK_TRACES
330 int starpu_pthread_barrier_wait(starpu_pthread_barrier_t *barrier);
331#else
332#define starpu_pthread_barrier_wait pthread_barrier_wait
333#endif
334#define STARPU_PTHREAD_BARRIER_SERIAL_THREAD PTHREAD_BARRIER_SERIAL_THREAD
335
336#endif /* STARPU_SIMGRID, !STARPU_HAVE_PTHREAD_BARRIER, _MSC_VER */
337
338/*
339 * Encapsulation of the pthread_spin_* functions.
340 */
341
342#if defined(STARPU_SIMGRID) || (defined(STARPU_LINUX_SYS) && defined(STARPU_HAVE_XCHG)) || !defined(STARPU_HAVE_PTHREAD_SPIN_LOCK)
343
344 typedef struct
345{
346#ifdef STARPU_SIMGRID
347 int taken;
348#elif defined(STARPU_LINUX_SYS) && defined(STARPU_HAVE_XCHG)
349 unsigned taken STARPU_ATTRIBUTE_ALIGNED(16);
350#else /* we only have a trivial implementation yet ! */
351 uint32_t taken STARPU_ATTRIBUTE_ALIGNED(16);
352#endif
353} starpu_pthread_spinlock_t;
354
355 int starpu_pthread_spin_init(starpu_pthread_spinlock_t *lock, int pshared);
356 int starpu_pthread_spin_destroy(starpu_pthread_spinlock_t *lock);
357 int starpu_pthread_spin_lock(starpu_pthread_spinlock_t *lock);
358 int starpu_pthread_spin_trylock(starpu_pthread_spinlock_t *lock);
359 int starpu_pthread_spin_unlock(starpu_pthread_spinlock_t *lock);
360
361#elif !defined(_MSC_VER) /* !( defined(STARPU_SIMGRID) || !defined(STARPU_HAVE_PTHREAD_SPIN_LOCK)) */
362
363 typedef pthread_spinlock_t starpu_pthread_spinlock_t;
364#define starpu_pthread_spin_init pthread_spin_init
365#define starpu_pthread_spin_destroy pthread_spin_destroy
366#define starpu_pthread_spin_lock pthread_spin_lock
367#define starpu_pthread_spin_trylock pthread_spin_trylock
368#define starpu_pthread_spin_unlock pthread_spin_unlock
369
370#endif /* !( defined(STARPU_SIMGRID) || !defined(STARPU_HAVE_PTHREAD_SPIN_LOCK)) */
371
372/*
373 * Other needed pthread definitions
374 */
375
376#if defined(_MSC_VER) && !defined(BUILDING_STARPU)
377 typedef void* starpu_pthread_rwlock_t;
378 typedef void* starpu_pthread_mutex_t;
379 typedef void* starpu_pthread_cond_t;
380 typedef void* starpu_pthread_barrier_t;
381#endif /* _MSC_VER */
382
383/*
384 * Simgrid-specific register/wait synchronization
385 *
386 * Producers create a "queue" object, and when they have produced something,
387 * they call either queue_signal or queue_broadcast in order to wake either one
388 * or all consumers waiting on the queue.
389 *
390 * starpu_pthread_queue_init(&global_queue1->queue);
391 * while (1) {
392 * element = compute();
393 * push(element, global_queue1);
394 * starpu_pthread_queue_signal(global_queue1);
395 * }
396 * starpu_pthread_queue_destroy(&global_queue1->queue);
397 *
398 * Consumers create a "wait" object, then queue_register on as many queues they
399 * want. In their consumption loop, they wait_reset, then test for availibility
400 * on all producers, and if none was available, call wait_wait to actually wait
401 * for producers. On termination, consumers have to queue_unregister before
402 * destroying the "wait" object:
403 *
404 * starpu_pthread_wait_t wait;
405 *
406 * starpu_pthread_wait_init(&wait);
407 * starpu_pthread_queue_register(&wait, &global_queue1->queue);
408 * starpu_pthread_queue_register(&wait, &global_queue2->queue);
409 *
410 * while (1) {
411 * int sleep = 1;
412 * starpu_pthread_wait_reset(&wait);
413 * if (global_queue1->navailable)
414 * {
415 * work(global_queue1);
416 * sleep = 0;
417 * }
418 * if (global_queue2->navailable)
419 * {
420 * work(global_queue2);
421 * sleep = 0;
422 * }
423 * if (sleep)
424 * starpu_pthread_wait_wait(&wait);
425 * }
426 * starpu_pthread_queue_unregister(&wait, &global_queue1->queue);
427 * starpu_pthread_queue_unregister(&wait, &global_queue2->queue);
428 * starpu_pthread_wait_destroy(&wait);
429 */
430
431#ifdef STARPU_SIMGRID
432 typedef struct
433{
434 starpu_pthread_mutex_t mutex;
435 starpu_pthread_cond_t cond;
436 unsigned block;
437} starpu_pthread_wait_t;
438
439 typedef struct
440{
441 starpu_pthread_mutex_t mutex;
442 starpu_pthread_wait_t **queue;
443 unsigned allocqueue;
444 unsigned nqueue;
445} starpu_pthread_queue_t;
446
447 int starpu_pthread_queue_init(starpu_pthread_queue_t *q);
448 int starpu_pthread_queue_signal(starpu_pthread_queue_t *q);
449 int starpu_pthread_queue_broadcast(starpu_pthread_queue_t *q);
450 int starpu_pthread_queue_destroy(starpu_pthread_queue_t *q);
451
452 int starpu_pthread_wait_init(starpu_pthread_wait_t *w);
453 int starpu_pthread_queue_register(starpu_pthread_wait_t *w, starpu_pthread_queue_t *q);
454 int starpu_pthread_queue_unregister(starpu_pthread_wait_t *w, starpu_pthread_queue_t *q);
455 int starpu_pthread_wait_reset(starpu_pthread_wait_t *w);
456 int starpu_pthread_wait_wait(starpu_pthread_wait_t *w);
457 int starpu_pthread_wait_timedwait(starpu_pthread_wait_t *w, const struct timespec *abstime);
458 int starpu_pthread_wait_destroy(starpu_pthread_wait_t *w);
459#endif
460
461/*
462 * Encapsulation of the semaphore functions.
463 */
464
465#ifdef STARPU_SIMGRID
466
467#ifdef STARPU_HAVE_SIMGRID_SEMAPHORE_H
468 typedef sg_sem_t starpu_sem_t;
469#else
470 typedef msg_sem_t starpu_sem_t;
471#endif
472 int starpu_sem_destroy(starpu_sem_t *);
473 int starpu_sem_getvalue(starpu_sem_t *, int *);
474 int starpu_sem_init(starpu_sem_t *, int, unsigned);
475 int starpu_sem_post(starpu_sem_t *);
476 int starpu_sem_trywait(starpu_sem_t *);
477 int starpu_sem_wait(starpu_sem_t *);
478
479#elif !defined(_MSC_VER) || defined(BUILDING_STARPU) /* !STARPU_SIMGRID */
480
481 typedef sem_t starpu_sem_t;
482#define starpu_sem_destroy sem_destroy
483#define starpu_sem_getvalue sem_getvalue
484#define starpu_sem_init sem_init
485#define starpu_sem_post sem_post
486 int starpu_sem_trywait(starpu_sem_t *);
487 int starpu_sem_wait(starpu_sem_t *);
488
489#endif
490
491#ifdef __cplusplus
492}
493#endif
494
495#endif /* __STARPU_THREAD_H__ */
starpu_pthread_barrier_destroy
int starpu_pthread_barrier_destroy(starpu_pthread_barrier_t *barrier)
starpu_pthread_mutexattr_init
int starpu_pthread_mutexattr_init(starpu_pthread_mutexattr_t *attr)
starpu_pthread_attr_destroy
int starpu_pthread_attr_destroy(starpu_pthread_attr_t *attr)
starpu_pthread_getspecific
void * starpu_pthread_getspecific(starpu_pthread_key_t key)
starpu_pthread_cond_wait
int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex)
starpu_pthread_rwlock_unlock
int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_key_delete
int starpu_pthread_key_delete(starpu_pthread_key_t key)
starpu_pthread_rwlock_init
int starpu_pthread_rwlock_init(starpu_pthread_rwlock_t *rwlock, const starpu_pthread_rwlockattr_t *attr)
starpu_pthread_rwlock_destroy
int starpu_pthread_rwlock_destroy(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_cond_init
int starpu_pthread_cond_init(starpu_pthread_cond_t *cond, starpu_pthread_condattr_t *cond_attr)
starpu_pthread_rwlock_tryrdlock
int starpu_pthread_rwlock_tryrdlock(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_key_create
int starpu_pthread_key_create(starpu_pthread_key_t *key, void(*destr_function)(void *))
starpu_pthread_cond_broadcast
int starpu_pthread_cond_broadcast(starpu_pthread_cond_t *cond)
starpu_pthread_spin_init
int starpu_pthread_spin_init(starpu_pthread_spinlock_t *lock, int pshared)
starpu_pthread_mutex_lock
int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
starpu_pthread_attr_setdetachstate
int starpu_pthread_attr_setdetachstate(starpu_pthread_attr_t *attr, int detachstate)
starpu_pthread_rwlock_rdlock
int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_cond_destroy
int starpu_pthread_cond_destroy(starpu_pthread_cond_t *cond)
starpu_pthread_spin_destroy
int starpu_pthread_spin_destroy(starpu_pthread_spinlock_t *lock)
starpu_pthread_exit
int starpu_pthread_exit(void *retval) STARPU_ATTRIBUTE_NORETURN
starpu_pthread_create
int starpu_pthread_create(starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
starpu_pthread_mutexattr_destroy
int starpu_pthread_mutexattr_destroy(starpu_pthread_mutexattr_t *attr)
starpu_pthread_rwlock_trywrlock
int starpu_pthread_rwlock_trywrlock(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_mutex_trylock
int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
starpu_pthread_join
int starpu_pthread_join(starpu_pthread_t thread, void **retval)
starpu_pthread_spin_lock
int starpu_pthread_spin_lock(starpu_pthread_spinlock_t *lock)
starpu_pthread_spin_unlock
int starpu_pthread_spin_unlock(starpu_pthread_spinlock_t *lock)
starpu_pthread_mutexattr_gettype
int starpu_pthread_mutexattr_gettype(const starpu_pthread_mutexattr_t *attr, int *type)
starpu_pthread_barrier_init
int starpu_pthread_barrier_init(starpu_pthread_barrier_t *barrier, const starpu_pthread_barrierattr_t *attr, unsigned count)
starpu_pthread_barrier_wait
int starpu_pthread_barrier_wait(starpu_pthread_barrier_t *barrier)
starpu_pthread_rwlock_wrlock
int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock)
starpu_pthread_spin_trylock
int starpu_pthread_spin_trylock(starpu_pthread_spinlock_t *lock)
starpu_pthread_setspecific
int starpu_pthread_setspecific(starpu_pthread_key_t key, const void *pointer)
starpu_pthread_mutex_init
int starpu_pthread_mutex_init(starpu_pthread_mutex_t *mutex, const starpu_pthread_mutexattr_t *mutexattr)
starpu_pthread_mutex_destroy
int starpu_pthread_mutex_destroy(starpu_pthread_mutex_t *mutex)
starpu_pthread_mutex_unlock
int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
starpu_pthread_cond_timedwait
int starpu_pthread_cond_timedwait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex, const struct timespec *abstime)
starpu_pthread_cond_signal
int starpu_pthread_cond_signal(starpu_pthread_cond_t *cond)
starpu_pthread_mutexattr_settype
int starpu_pthread_mutexattr_settype(starpu_pthread_mutexattr_t *attr, int type)
starpu_pthread_attr_init
int starpu_pthread_attr_init(starpu_pthread_attr_t *attr)
STARPU_ATTRIBUTE_NORETURN
#define STARPU_ATTRIBUTE_NORETURN
Definition: starpu_util.h:94
STARPU_ATTRIBUTE_ALIGNED
#define STARPU_ATTRIBUTE_ALIGNED(size)
Definition: starpu_util.h:139
starpu_config.h
starpu_pthread_barrier_t
Definition: starpu_thread.h:305
starpu_pthread_queue_t
Definition: starpu_thread.h:440
starpu_pthread_spinlock_t
Definition: starpu_thread.h:345
starpu_pthread_wait_t
Definition: starpu_thread.h:433
starpu_util.h