On Thu, Apr 25, 2002 at 01:32:40PM -0400, Bill Stoddard wrote: > I think he is referring to the order the threads are dispatched. Ideally you want >the last > active thread to get the next work (ie, LIFO dispatching).
Actually Ryan was correct, and I meant FIFO. There are two approaches to the "worker queue". The first, which is what we have in CVS, is to treat the elements of the queue as accepted connections that need to be processed. Workers then come to the queue and pull of "work" to be done. The second, which is what we have in my time-space tradeoff (now mutated into the threadpool MPM thanks to Brian) takes a different approach, where elements of the queue are treated as available worker threads. In the first approach, where elements are connections, we want connections to be serviced in order so we obviously need a queue (right now it is a stack). In the second approach where queue elements are simply worker threads, to take advantage of cache coherency/locality we'd prefer that the most-recently used worker be reused instead of having to wake up (and possibly pagein, cachein, etc...) another sleeping worker. [You probably are already aware of all of this, so treat the above description as for the sake of the group.] -aaron