Ryan Bloom wrote: >It's amazing, but we have had this design before. In fact, this was the >threaded MPM. The reason we removed that MPM, was that it falls apart >when trying to do a restart. >
The threaded MPM was a rather different design. It suffered from having no centralized means to reliably signal the idle threads upon restart. >The easy way to fix the problem you observed is to have the listener >thread not call accept if there are no free worker threads. That is why >we originally had two condition variables in the worker design. > I'm somewhat opposed to that approach because it adds a bit of code to the critical region protected by the global mutex. Worker already has way too much contention on that mutex, so we need to make the mutex-protected region smaller, not larger. (The shorter the critical region, the smaller the mean number of threads blocked on that mutex...and the faster it will run, especially on systems like Solaris where uncontended mutexes don't require a syscall.) --Brian