httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1783755 - /httpd/httpd/trunk/server/mpm/event/event.c
Date Mon, 20 Feb 2017 16:41:29 GMT
[Keeping httpd list here only]

On Mon, Feb 20, 2017 at 3:51 PM, Stefan Eissing
<stefan.eissing@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?

Mime
View raw message