> Am 20.02.2017 um 17:41 schrieb Yann Ylavic <ylavic....@gmail.com>: > > [Keeping httpd list here only] > > On Mon, Feb 20, 2017 at 3:51 PM, Stefan Eissing > <stefan.eiss...@greenbytes.de> wrote: >> >> So, apr_p*alloc() calls would be thread-safe if a mutex is set in >> the underlying allocator? Hmm, at what cost? would be my question. > > I also fear that it would be costly when not needed (e.g. request's pool). > Because yes, the allocator is inherited from the parent pool if none > is specified at creation time, and hence with this commit every child > pool of ptrans will have a mutexed allocator. > >> >> In regard to thread safety of apr_allocator, there is still something >> I do not understand. Observations: >> >> 1. When I remove the own allocator in h2_mplx, so it inherits the >> now protected one from the master connection, all runs fine. > > I'm not sure this dedicated allocator is needed, mplx seems to race > only with itself on ptrans (master->pool), but I may miss something. > >> 2. When I remove the own allocator from the slave connections also, >> in h2_conn, so that slave conns also use the protected allocator >> from the master conn, > > Hmm, rather the allocator from mplx->pool (since slave connections are > children of mplx), right? > >> things break. E.g. strange behaviour up >> to crashes under load. > > Is it with or without this commit? > Also with 1. + 2., or 2. alone?
1+2, so the only allocator is from master conn_rec.