Table of Contents
N_PARALLEL_TEAM
A team of threads kept alive between parallel loops. More...
Public Attributes
| Name | |
|---|---|
| N_PARALLEL_WORKER * | workers the size - 1 workers |
| void * | user the current loop: passed to the work |
| int | stopping 1 when the workers must exit; written under lock, read with __atomic loads |
| pthread_cond_t | start signalled when a new loop is published or the team is stopping |
| size_t | size participants, the caller of a loop included |
| pthread_mutex_t | run_lock serializes the loops of the threads sharing the team |
| size_t | pending workers that have not finished the current loop yet (__atomic) |
| size_t | nb_slices the current loop: number of slices |
| pthread_mutex_t | lock guards every field below |
| unsigned long long | generation bumped once per published loop, workers compare it to the last they ran; written under lock, read with __atomic loads while spinning |
| N_PARALLEL_FN | fn the current loop: the work |
| pthread_cond_t | done signalled when the last worker is done with the current loop |
| size_t | count the current loop: item count |
| size_t | begin the current loop: first index |
Detailed Description
struct N_PARALLEL_TEAM;
A team of threads kept alive between parallel loops.
A team of threads kept alive between parallel loops, see n_parallel_team_new().
Public Attributes Documentation
variable workers
N_PARALLEL_WORKER * workers;
the size - 1 workers
variable user
void * user;
the current loop: passed to the work
variable stopping
int stopping;
1 when the workers must exit; written under lock, read with __atomic loads
variable start
pthread_cond_t start;
signalled when a new loop is published or the team is stopping
variable size
size_t size;
participants, the caller of a loop included
variable run_lock
pthread_mutex_t run_lock;
serializes the loops of the threads sharing the team
variable pending
size_t pending;
workers that have not finished the current loop yet (__atomic)
variable nb_slices
size_t nb_slices;
the current loop: number of slices
variable lock
pthread_mutex_t lock;
guards every field below
variable generation
unsigned long long generation;
bumped once per published loop, workers compare it to the last they ran; written under lock, read with __atomic loads while spinning
variable fn
N_PARALLEL_FN fn;
the current loop: the work
variable done
pthread_cond_t done;
signalled when the last worker is done with the current loop
variable count
size_t count;
the current loop: item count
variable begin
size_t begin;
the current loop: first index
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB