thread safety and mpm-prefork

2013-06-11 Thread Alex Bligh
I've written a module which I believe to be thread-safe but appears to be doing something which I have put down to a lack of thread safety in pool management (somewhere). Before I tear my hair out here, my module is running with apache 2.2.22 and mpm-prefork on Ubuntu. Do the thread primatives act

Re: thread safety and mpm-prefork

2013-06-11 Thread Sorin Manolache
On 2013-06-11 21:20, Alex Bligh wrote: I've written a module which I believe to be thread-safe but appears to be doing something which I have put down to a lack of thread safety in pool management (somewhere). Before I tear my hair out here, my module is running with apache 2.2.22 and mpm-prefor

Re: thread safety and mpm-prefork

2013-06-11 Thread Alex Bligh
Sorin, On 11 Jun 2013, at 21:10, Sorin Manolache wrote: > apr_* and mpm_prefork are different software packages and ubuntu distributes > them separately. So it is almost certain that you have a thread-enabled > libapr (i.e. compiled with APR_HAS_THREADS). You would not be able to compile > the

Re: thread safety and mpm-prefork

2013-06-11 Thread Sorin Manolache
On 2013-06-11 22:21, Alex Bligh wrote: Sorin, On 11 Jun 2013, at 21:10, Sorin Manolache wrote: apr_* and mpm_prefork are different software packages and ubuntu distributes them separately. So it is almost certain that you have a thread-enabled libapr (i.e. compiled with APR_HAS_THREADS). You

Re: thread safety and mpm-prefork

2013-06-11 Thread Alex Bligh
Sorin, On 11 Jun 2013, at 21:57, Sorin Manolache wrote: > The threadallocatormutex is created from a child of the request pool. The > request pool and its child-pools are destroyed when the request terminates. > Do you use the threadpool/threadallocator/threadallocatormutex afterwards? Nope. I

Re: thread safety and mpm-prefork

2013-06-11 Thread Sorin Manolache
On 2013-06-11 23:08, Alex Bligh wrote: Sorin, On 11 Jun 2013, at 21:57, Sorin Manolache wrote: The threadallocatormutex is created from a child of the request pool. The request pool and its child-pools are destroyed when the request terminates. Do you use the threadpool/threadallocator/threa

Re: thread safety and mpm-prefork

2013-06-11 Thread Alex Bligh
On 11 Jun 2013, at 23:06, Sorin Manolache wrote: > I'm sorry, I ran out of ideas. I suppose that the operations of the two > threads on the bucket brigade are protected by mutexes... Yep. I create my own output bucket brigade too. I *presume* this uses the allocator mutex to manipulate the buc