The cleanup handler is a brilliant idea.  That removes the need for a
polling thread.  If I attach the cleanup to the request's pool and run in a
threaded MPM, this led to contention for the globals that I'm updating in
C.  Is this the case with PerlModules, or can I get away without locking
them?

Thanks,

SB

On Wed, May 19, 2010 at 6:13 PM, Perrin Harkins <per...@elem.com> wrote:

> On Wed, May 19, 2010 at 4:37 PM, Some Guy <teknos...@gmail.com> wrote:
> > if I have a ChildInitHandler, any changes I make to globals are not
> > reflected in a HeaderParserHandler.  My globals do not have the :shared
> > attribute - must they?
>
> Only if you're trying to update them from a different thread.  If
> there aren't multiple threads involved, you can update globals from
> anywhere.  If that's not working for you there's probably a mistake in
> the way you're referring to the variables.  If you post some code we
> may be able to help.
>
> > Is there a way to do what I want in mod_perl -
> > namely have a HeaderParserHandler that uses data for some logic where
> that
> > data is updated from some other thread that I spawn?
>
> A more common approach with perl is to make a handler that runs in an
> early phase which reloads the data as needed, and not use a separate
> thread.  If you're concerned about reloading the data adding too much
> delay to a web request, you could do this in a cleanup handler.
>
> - Perrin
>

Reply via email to