On 09.05.2013 18:43, Ivan Zhakov wrote:
> On Thu, May 9, 2013 at 8:41 PM, Philip Martin
> <philip.martin_at_wandisco.com> wrote:
>> Branko Čibej <brane_at_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.
Like an interlocked queue of thread-created events?
> Another way is to use OS call directly instead of using APR.
I'd rather avoid that if at all possible. In theory we could use
threaded svnserve on other platforms, not just Windows.
Director of Subversion | WANdisco | www.wandisco.com
Received on 2013-05-09 20:58:30 CEST