[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: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 09 May 2013 17:41:21 +0100

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.

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2013-05-09 18:42:16 CEST

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