thread_pool_addrequest()
returns if it cannot spawn a thread per each request. It returns before adding the request to the queue. Does that mean the server will ignore requests if it cannot spawn a thread at the time of arrival? If so, wouldnt it be better to queue it and hope for the availability of threads in the near future? Something like this thread_pool_addrequest() while ((thread_pool.total_threads - thread_pool.active_threads) < lrad_hash_table_num_elements(thread_pool.queue)) { if (spawn_thread(request->timestamp) == NULL) { radlog(L_INFO, "The maximum number of threads (%d) are active, cannot spawn new thread to handle request", thread_pool.max_threads); break; } }
Joe Maimon <jmaimon@ttec.com> wrote:
Does that mean the server will ignore requests if it cannot spawn a thread at the time of arrival?
Tes.
If so, wouldnt it be better to queue it and hope for the availability of threads in the near future?
Yes.
Something like this thread_pool_addrequest()
No, just move the "request_enqueue" code to before the "spawn thread" checks. I'll commit a fix to CVS. Alan DeKok.
participants (2)
-
Alan DeKok -
Joe Maimon