perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Some Guy <>
Subject PerlModule lifetime / threads
Date Wed, 19 May 2010 20:37:31 GMT
Hey all,

I am trying to port a module I wrote in C to one that uses mod_perl.  The C
module would spawn a thread in the child_init process and poll a file.  The
file polled contained data that the header parser phase would use.  I
protected the data via a RW Lock.

Now when doing this in mod_perl I see the following things:

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?

I've had better luck getting rid of the ChildInit directive and initializing
globals like a normal script.  Then my handler routine can see what I've
initialized.  I can even spawn a thread.  Unfortunately, changes to a shared
array that my thread makes are not picked up by the handler.

I'm definitely missing something here as I'm approaching this from a C
module perspective where I had access to the right hooks and knew what
process I'd be running in.  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?



View raw message