47 #ifndef _THREAD_POOL_H_
48 #define _THREAD_POOL_H_
56 void *(*func)(
void *
arg);
141 void *(*func)(
void *arg),
void *arg);
143 void *(*func)(
void *arg),
void *arg,
int nonblock);
int curr_serial
Definition: thread_pool.h:112
struct t_pool_job t_pool_job
long long wait_time
Definition: thread_pool.h:105
int nwaiting
Definition: thread_pool.h:84
t_pool_result * t_pool_next_result_wait(t_results_queue *q)
Definition: thread_pool.c:175
long long total_time
Definition: thread_pool.h:105
int next_serial
Definition: thread_pool.h:111
int t_pool_results_queue_len(t_results_queue *q)
Definition: thread_pool.c:217
struct t_pool * p
Definition: thread_pool.h:74
int t_pool_dispatch(t_pool *p, t_results_queue *q, void *(*func)(void *arg), void *arg)
Definition: thread_pool.c:488
long long wait_time
Definition: thread_pool.h:78
int serial
Definition: thread_pool.h:67
int t_pool_results_queue_sz(t_results_queue *q)
Definition: thread_pool.c:227
void * arg
Definition: thread_pool.h:57
Definition: thread_pool.h:81
struct t_results_queue t_results_queue
t_pool_worker_t * t
Definition: thread_pool.h:92
pthread_mutex_t result_m
Definition: thread_pool.h:115
pthread_mutex_t pool_m
Definition: thread_pool.h:95
int tsize
Definition: thread_pool.h:91
pthread_t tid
Definition: thread_pool.h:76
struct t_res t_pool_result
Definition: thread_pool.h:65
t_results_queue * t_results_queue_init(void)
Definition: thread_pool.c:257
int t_pool_flush(t_pool *p)
Definition: thread_pool.c:634
int queue_len
Definition: thread_pool.h:113
int t_pool_dispatch2(t_pool *p, t_results_queue *q, void *(*func)(void *arg), void *arg, int nonblock)
Definition: thread_pool.c:550
pthread_cond_t pending_c
Definition: thread_pool.h:98
pthread_cond_t pending_c
Definition: thread_pool.h:77
int qsize
Definition: thread_pool.h:82
pthread_cond_t result_avail_c
Definition: thread_pool.h:116
t_pool_job * tail
Definition: thread_pool.h:88
int * t_stack
Definition: thread_pool.h:102
t_pool_result * t_pool_next_result(t_results_queue *q)
Definition: thread_pool.c:157
int idx
Definition: thread_pool.h:75
int t_stack_top
Definition: thread_pool.h:102
int t_pool_results_queue_empty(t_results_queue *q)
Definition: thread_pool.c:203
void * data
Definition: thread_pool.h:68
int njobs
Definition: thread_pool.h:83
t_pool * t_pool_init(int qsize, int tsize)
Definition: thread_pool.c:421
struct t_results_queue * q
Definition: thread_pool.h:61
struct t_pool * p
Definition: thread_pool.h:60
int shutdown
Definition: thread_pool.h:85
int pending
Definition: thread_pool.h:114
pthread_cond_t full_c
Definition: thread_pool.h:99
Definition: thread_pool.h:108
Definition: thread_pool.h:73
struct t_pool_job * next
Definition: thread_pool.h:58
void t_results_queue_destroy(t_results_queue *q)
Definition: thread_pool.c:274
struct t_res * next
Definition: thread_pool.h:66
pthread_cond_t empty_c
Definition: thread_pool.h:97
void t_pool_destroy(t_pool *p, int kill)
Definition: thread_pool.c:670
t_pool_job * head
Definition: thread_pool.h:88
t_pool_result * result_head
Definition: thread_pool.h:109
int serial
Definition: thread_pool.h:62
t_pool_result * result_tail
Definition: thread_pool.h:110
void t_pool_delete_result(t_pool_result *r, int free_data)
Definition: thread_pool.c:241
Definition: thread_pool.h:55