httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thib <chep...@gmail.com>
Subject Re: Handler method is it executed in mutex?
Date Fri, 04 Apr 2008 10:23:36 GMT
Hi,

Thanks a lot for this response. I didn't succeed in watching a bug with gdb
on this part but I'm going to treat global configuration as read-only.

Thanks a lot.

Thib

2008/4/4, Nick Kew <nick@webthing.com>:
>
> On Fri, 4 Apr 2008 09:04:50 +0200
> Thib <cheprod@gmail.com> wrote:
>
> > Hi,
> >
> > I'm developping an Apache Module, and I ask me a question about the
> > execution of the handler.
> >
> > Do you know if the handler is executed in mutex (mutual exclusion) ?
>
>
> It isn't.
>
>
> > In the method create_snu_config, I allocate the memory :
>
>
> Anything created there should be treated as read-only at request
> processing time.  If you need to change that, you can create a
> mutex, but even then you're in danger of leaking memory, by
> causing the child process to make its own copy of a global pool.
>
>
> > And in the handler I read/write variables :
> >
> >          strncpy(s_cfg->eni.calling,&buffer[iDebut],iTaille);
>
>
> Actually you can do that with a mutex, since you're not allocating
> anything new from the config pool.  But I wouldn't recommend it.
> Use a local variable.  If you need request-local variables to be
> available over multiple hooks/callbacks, use the request config.
>
>
> --
> Nick Kew
>
> Application Development with Apache - the Apache Modules Book
> http://www.apachetutor.org/
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message