Branko Čibej <br...@wandisco.com> writes: > On 09.05.2013 17:14, Ivan Zhakov wrote: >>> Perhaps we have to look at the httpd code? >>> >> httpd doesn't create worker thread dynamically, so they can allocate >> apr_thread_t in global pool. Also it has dedicated win32 mpm that uses >> CreateThread Windows API directly. > > I'm beginning to think that we need a global thread pool object that's > independent of actual connections, that we create at process startup and > that contains its own root pool for creating new threads.
I don't think that solves the problem. We have a loop calling apr_thread_create so the pool passed to apr_thread_create has to be cleared or destroyed. We can only do that when both: A: the call itself has finished B: the new thread has started running The thread itself can't clear the pool (the current code) because that doesn't guarantee A. We can't use a subpool (Ivan's patch) because that doesn't guarantee B. I think we have to add some inter-thread communication and have the main thread track the worker threads in some way. -- Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download