Shadow Network Framework
0.0.2-alpha
C Server Library for Shadow Network Framework
|
The structure for a Thread Pool. More...
#include <SNF/thpool.h>
Data Fields | |
SNF_thpool_work * | thpool_works |
This LinkedList will store the "works" or "jobs". | |
sem_t | thpool_works_sem |
This is the semaphore for handling. | |
SNF_thpool_worker * | thpool_workers |
This LinkedList will store the currently working "workers" or more exactly the worker thread info. | |
pthread_mutex_t | thpool_works_MUTEX |
Used to synchronize the acces to thpool_works. | |
pthread_mutex_t | thpool_workers_MUTEX |
Used to synchronize the acces to thpool_workers. | |
pthread_mutex_t | thpool_noworks_MUTEX |
Used to synchronize if all "works" are handled and all "workers" had finished their assigned "work" See snf_thpool_wait(SNF_thpool *pool) | |
pthread_t * | thpool_handler |
Thread that manages "workers" and assign their "work" to them. | |
pthread_t * | thpool_main_worker |
The main function that is runs first when the Thread pool has started. | |
sem_t | thpool_workers_sem |
Semaphore used for synchronization; Used primarly to notify the conclusion of "workers" to the Thread pool handler, and to Limit the amount of "worker" threads with the max being thpool_n_workers. | |
int | thpool_n_workers |
Limiter for the amount of threads that could be created. | |
SNF_thpool_status | thpool_status |
If set = 1 the thpool_handler will stop creating "workers" and wait till all already exising "workers" finish their "work". | |
pthread_mutex_t | thpool_status_MUTEX |
pthread_cond_t | thpool_status_COND |
sem_t | thpool_status_sem |
The structure for a Thread Pool.
SNF_thpool_work* SNF_ThreadPool_t::thpool_works |
This LinkedList will store the "works" or "jobs".
sem_t SNF_ThreadPool_t::thpool_works_sem |
This is the semaphore for handling.
SNF_thpool_worker* SNF_ThreadPool_t::thpool_workers |
This LinkedList will store the currently working "workers" or more exactly the worker thread info.
pthread_mutex_t SNF_ThreadPool_t::thpool_works_MUTEX |
Used to synchronize the acces to thpool_works.
pthread_mutex_t SNF_ThreadPool_t::thpool_workers_MUTEX |
Used to synchronize the acces to thpool_workers.
pthread_mutex_t SNF_ThreadPool_t::thpool_noworks_MUTEX |
Used to synchronize if all "works" are handled and all "workers" had finished their assigned "work" See snf_thpool_wait(SNF_thpool *pool)
pthread_t* SNF_ThreadPool_t::thpool_handler |
Thread that manages "workers" and assign their "work" to them.
pthread_t* SNF_ThreadPool_t::thpool_main_worker |
The main function that is runs first when the Thread pool has started.
sem_t SNF_ThreadPool_t::thpool_workers_sem |
Semaphore used for synchronization; Used primarly to notify the conclusion of "workers" to the Thread pool handler, and to Limit the amount of "worker" threads with the max being thpool_n_workers.
int SNF_ThreadPool_t::thpool_n_workers |
Limiter for the amount of threads that could be created.
SNF_thpool_status SNF_ThreadPool_t::thpool_status |
If set = 1 the thpool_handler will stop creating "workers" and wait till all already exising "workers" finish their "work".
pthread_mutex_t SNF_ThreadPool_t::thpool_status_MUTEX |
pthread_cond_t SNF_ThreadPool_t::thpool_status_COND |
sem_t SNF_ThreadPool_t::thpool_status_sem |