|
From: <gne...@us...> - 2007-10-22 22:56:24
|
Update of /cvsroot/aolserver/aolserver/nsd In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv19325 Modified Files: queue.c Log Message: Remove old code for allowing to run more than maxconn requests in one thread (replaced by thread creation); Maintain min-threads threads when threads are exiting. Index: queue.c =================================================================== RCS file: /cvsroot/aolserver/aolserver/nsd/queue.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** queue.c 21 Oct 2007 21:38:09 -0000 1.42 --- queue.c 22 Oct 2007 22:56:23 -0000 1.43 *************** *** 379,398 **** Ns_MutexLock(&poolPtr->lock); ! /* ! The last test (poolPtr->queue.wait.num > 0) might lead to situations ! where a single connection thread processes more than maxconns ! connection requests. This condition fixes situations, where the ! driver accepts more connection requests than resources available. ! When e.g. the number of queued requests is higher than connections per threads, ! this might lead to situations, where there server comes to a halt. ! Maybe it is a good idea to limit the number of queued requests or ! to start a new thread automatically, when the current one exists due ! to max conns. However, the test with the queue.wait.num consition ! is better than a hang. ! */ ! while (poolPtr->threads.maxconns <= 0 ! || ncons-- > 0 ! /*|| poolPtr->queue.wait.num > 1*/ ! ) { /* --- 379,383 ---- Ns_MutexLock(&poolPtr->lock); ! while (poolPtr->threads.maxconns <= 0 || ncons-- > 0) { /* *************** *** 504,511 **** } ! if (poolPtr->queue.wait.num > 0 && poolPtr->threads.idle == 0 && !poolPtr->shutdown) { ! /* We are exiting from a thread in a situation, where more ! queue entries are waiting. Since no other mechanism ensures ! that the entries are processed, we recreate a new connection thread. */ poolPtr->threads.current++; --- 489,501 ---- } ! ! if (((poolPtr->queue.wait.num > 0 && poolPtr->threads.idle == 0) ! || (poolPtr->threads.current < poolPtr->threads.min) ! ) && !poolPtr->shutdown) { ! /* ! We are either exiting from a thread in a situation, where more ! queue entries are still waiting, or ! we have less than minthreads connection threads alive. ! In these situations recreate a connection thread. */ poolPtr->threads.current++; |