KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
barrier.h File Reference

Thread barriers. More...

#include <sys/cdefs.h>

Go to the source code of this file.

Data Structures

union  thd_barrier_t
 Thread barrier type. More...
 

Macros

#define THD_BARRIER_SERIAL_THREAD   0x7fffffff
 Constant returned to one thread from pthread_barrier_wait().
 
#define THD_BARRIER_SIZE   64
 Size of a thread barrier, in bytes.
 

Functions

int thd_barrier_init (thd_barrier_t *__RESTRICT barrier, const void *__RESTRICT attr, unsigned count)
 Initialize a thread barrier.
 
int thd_barrier_destroy (thd_barrier_t *barrier)
 Destroy a thread barrier.
 
int thd_barrier_wait (thd_barrier_t *barrier)
 Wait on a thread barrier.
 

Detailed Description

Thread barriers.

Thread barriers are used to synchronize the progress of multiple threads. A barrier causes threads to wait until a specified number of threads have reached a certain execution point, ensuring a consistent state across different execution paths.

This synchronization primitive is essential for scenarios in parallel programming where tasks executed by multiple threads must reach a certain point before any can proceed, ensuring data consistency and coordination among threads.

Author
Lawrence Sebald