Thread Per-Request (Cont.) Finally, the main function, to find them, and in the system - bind them. int main() { struct active_threads* threads = (struct active_threads*) malloc(sizeof(struct active_threads)); struct mgr_thread_data* mgr_data = (struct mgr_thread_data*) malloc(sizeof(struct mgr_thread_data)); int should_exit = 0; pthread_t mgr_thread; int* thr_retval; /* init structures. */ pthread_mutex_init(&threads->mutex); pthread_cond_init(&threads->cond); threads->num_threads = 0; threads->max_num_threads = 20; mgr_data->threads = threads; mgr_data->q = q_init(); mgr_data->should_exit = &should_exit;