[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Thread issues in svnserve

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Thu, 9 May 2013 20:43:30 +0400

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.
>
Another way is to use OS call directly instead of using APR.

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Received on 2013-05-09 18:44:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.