Destroy a barrier.
int myth_barrier_destroy( myth_barrier_t * barrier )
Initialize a barrier.
int myth_barrier_init( myth_barrier_t * barrier, const myth_barrierattr_t * attr, unsigned int count )
Wait on a barrier.
int myth_barrier_wait( myth_barrier_t * barrier )
int myth_barrierattr_destroy( myth_barrierattr_t * attr )
int myth_barrierattr_init( myth_barrierattr_t * attr )
int myth_cancel( myth_thread_t th )
Wake up all threads blocking on a condition variable.
int myth_cond_broadcast( myth_cond_t * cond )
Destroy a condition variable.
int myth_cond_destroy( myth_cond_t * cond )
Initialize a condition variable.
int myth_cond_init( myth_cond_t * cond, const myth_condattr_t * attr )
Wake up at least one thread blocking on a condition variable.
int myth_cond_signal( myth_cond_t * c )
int myth_cond_timedwait( myth_cond_t * cond, myth_mutex_t * mutex, const struct timespec * abstime )
Atomically unlock a mutex and block on a condition variable.
int myth_cond_wait( myth_cond_t * cond, myth_mutex_t * mutex )
int myth_condattr_destroy( myth_condattr_t * attr )
int myth_condattr_init( myth_condattr_t * attr )
Create a new user-level thread executing func(arg) with default options.
myth_thread_t myth_create( myth_func_t func, void * arg )
Create a new user-level thread executing func(arg) with specified options.
int myth_create_ex( myth_thread_t * id, myth_thread_attr_t * attr, myth_func_t func, void * arg )
Create many user-level threads executing the same function with various arguments and attributes and wait for them to complete.
int myth_create_join_many_ex( myth_thread_t * ids, myth_thread_attr_t * attrs, myth_func_t func, void * args, void * results, size_t id_stride, size_t attr_stride, size_t arg_stride, size_t result_stride, long nthreads )
Create many user-level threads executing various functions with various arguments and attributes and wait for them to complete.
int myth_create_join_various_ex( myth_thread_t * ids, myth_thread_attr_t * attrs, myth_func_t * funcs, void * args, void * results, size_t id_stride, size_t attr_stride, size_t func_stride, size_t arg_stride, size_t result_stride, long nthreads )
int myth_detach( myth_thread_t th )
int myth_equal( myth_thread_t t1, myth_thread_t t2 )
Terminate the calling user-level thread.
void myth_exit( void * ret )
int myth_felock_destroy( myth_felock_t * fe )
int myth_felock_init( myth_felock_t * fe, const myth_felockattr_t * attr )
int myth_felock_lock( myth_felock_t * fe )
int myth_felock_mark_and_signal( myth_felock_t * fe, int status_to_signal )
int myth_felock_status( myth_felock_t * fe )
int myth_felock_unlock( myth_felock_t * fe )
int myth_felock_wait_and_lock( myth_felock_t * fe, int status_to_wait )
int myth_felockattr_destroy( myth_felockattr_t * attr )
int myth_felockattr_init( myth_felockattr_t * attr )
Finalize MassiveThreads.
void myth_fini( void )
The number of underlying workers.
int myth_get_num_workers( void )
The index of the calling thread, an integer x satisfying 0 <= x < myth_get_num_workers().
int myth_get_worker_num( void )
int myth_getattr_default_np( myth_thread_attr_t * attr )
int myth_getattr_np( myth_thread_t thread, myth_thread_attr_t * attr )
int myth_getconcurrency( void )
Obtain a user-level thread-specific data associated with a key.
void *myth_getspecific( myth_key_t key )
int myth_globalattr_destroy( myth_globalattr_t * attr )
int myth_globalattr_get_bind_workers( myth_globalattr_t * attr, int * bind_workers )
int myth_globalattr_get_n_workers( myth_globalattr_t * attr, size_t * n_workers )
int myth_globalattr_get_stacksize( myth_globalattr_t * attr, size_t * stacksize )
int myth_globalattr_init( myth_globalattr_t * attr )
int myth_globalattr_set_bind_workers( myth_globalattr_t * attr, int bind_workers )
int myth_globalattr_set_n_workers( myth_globalattr_t * attr, size_t n_workers )
int myth_globalattr_set_stacksize( myth_globalattr_t * attr, size_t stacksize )
Initialize MassiveThreads library with default parameters (see myth_init_ex).
int myth_init( void )
Initialize MassiveThreads library with the specified global attributes.
int myth_init_ex( myth_globalattr_t * attr )
1 if the calling OS-level thread is a massivethreads worker.
int myth_is_myth_worker( void )
Wait for the specified thread th to finish.
int myth_join( myth_thread_t th, void ** result )
int myth_join_counter_dec( myth_join_counter_t * jc )
int myth_join_counter_init( myth_join_counter_t * jc, const myth_join_counterattr_t * attr, int val )
int myth_join_counter_wait( myth_join_counter_t * jc )
int myth_join_counterattr_destroy( myth_join_counterattr_t * attr )
int myth_join_counterattr_init( myth_join_counterattr_t * attr )
Create a key for user-level thread-specific data.
int myth_key_create( myth_key_t * key, void (*destr_function)(void *) )
Delete a key for user-level thread-specific data.
int myth_key_delete( myth_key_t key )
Destroy a mutex.
int myth_mutex_destroy( myth_mutex_t * mutex )
Initialize a mutex.
int myth_mutex_init( myth_mutex_t * mutex, const myth_mutexattr_t * attr )
Lock a mutex.
int myth_mutex_lock( myth_mutex_t * mtx )
Lock a mutex.
int myth_mutex_timedlock( myth_mutex_t * mtx, const struct timespec * abstime )
Try to lock a mutex.
int myth_mutex_trylock( myth_mutex_t * mtx )
Unlock a mutex.
int myth_mutex_unlock( myth_mutex_t * mtx )
int myth_mutexattr_destroy( myth_mutexattr_t * attr )
int myth_mutexattr_gettype( const myth_mutexattr_t * attr, int * type )
int myth_mutexattr_init( myth_mutexattr_t * attr )
int myth_mutexattr_settype( myth_mutexattr_t * attr, int type )
int myth_nanosleep( const struct timespec * req, struct timespec * rem )
int myth_once( myth_once_t * once_control, void (*init_routine)(void) )
int myth_rwlock_destroy( myth_rwlock_t * rwlock )
int myth_rwlock_init( myth_rwlock_t * rwlock, const myth_rwlockattr_t * attr )
int myth_rwlock_rdlock( myth_rwlock_t * rwlock )
int myth_rwlock_timedrdlock( myth_rwlock_t * rwlock, const struct timespec * abstime )
int myth_rwlock_timedwrlock( myth_rwlock_t * rwlock, const struct timespec * abstime )
int myth_rwlock_tryrdlock( myth_rwlock_t * rwlock )
int myth_rwlock_trywrlock( myth_rwlock_t * rwlock )
int myth_rwlock_unlock( myth_rwlock_t * rwlock )
int myth_rwlock_wrlock( myth_rwlock_t * rwlock )
int myth_rwlockattr_destroy( myth_rwlockattr_t * attr )
int myth_rwlockattr_getkind( const myth_rwlockattr_t * attr, int * pref )
int myth_rwlockattr_init( myth_rwlockattr_t * attr )
int myth_rwlockattr_setkind( myth_rwlockattr_t * attr, int pref )
int myth_sched_yield( void )
The identifier of the calling thread.
myth_thread_t myth_self( void )
int myth_setcancelstate( int state, int * oldstate )
int myth_setcanceltype( int type, int * oldtype )
Associate a thread-specific data with a key.
int myth_setspecific( myth_key_t key, const void * data )
unsigned int myth_sleep( unsigned int s )
int myth_spin_destroy( myth_spinlock_t * lock )
int myth_spin_init( myth_spinlock_t * lock )
int myth_spin_lock( myth_spinlock_t * lock )
int myth_spin_trylock( myth_spinlock_t * lock )
int myth_spin_unlock( myth_spinlock_t * lock )
void myth_testcancel( void )
int myth_thread_attr_getdetachstate( const myth_thread_attr_t * attr, int * detachstate )
int myth_thread_attr_getguardsize( const myth_thread_attr_t * attr, size_t * guardsize )
int myth_thread_attr_getstack( const myth_thread_attr_t * attr, void ** stackaddr, size_t * stacksize )
int myth_thread_attr_getstacksize( const myth_thread_attr_t * attr, size_t * stacksize )
int myth_thread_attr_init( myth_thread_attr_t * attr )
int myth_thread_attr_setdetachstate( myth_thread_attr_t * attr, int detachstate )
int myth_thread_attr_setguardsize( myth_thread_attr_t * attr, size_t guardsize )
int myth_thread_attr_setstack( myth_thread_attr_t * attr, void * stackaddr, size_t stacksize )
int myth_thread_attr_setstacksize( myth_thread_attr_t * attr, size_t stacksize )
destroy an uncondition variable.
int myth_uncond_destroy( myth_uncond_t * u )
initialize an uncondition variable.
int myth_uncond_init( myth_uncond_t * uncond )
unblock the thread blocking on uncond.
int myth_uncond_signal( myth_uncond_t * uncond )
block on an uncondition variable, to be waken up later by myth_uncond_signal.
int myth_uncond_wait( myth_uncond_t * uncond )
int myth_usleep( useconds_t usec )
Obtain a worker-specific data associated with a key.
void *myth_wls_getspecific( myth_wls_key_t key )
Create a key for worker-specific data.
int myth_wls_key_create( myth_wls_key_t * key, void (*destr_function)(void *) )
Delete a key for worker-specific data.
int myth_wls_key_delete( myth_wls_key_t key )
Associate a worker-specific data with a key.
int myth_wls_setspecific( myth_wls_key_t key, const void * data )
it is equivalent to myth_yield_ex(myth_yield_option_half_half); with probability 1/2, try to yield to a thread in the local queue and if none is found try to steal a thread from a remote queue.
void myth_yield( void )
Yield execution to another user-level thread.
void myth_yield_ex( int yield_opt )