httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alin vasile <>
Subject Re: Process lifetime and hooks to use
Date Fri, 16 Apr 2010 21:06:00 GMT

   I made a similar thread that monitors a separate process and I put its init/start procedure
in the post_config hook. Remember to register a function that closes it when the config memory
pool is destroyed.


From: Some Guy <>
Sent: Fri, April 16, 2010 10:51:40 PM
Subject: Process lifetime and hooks to use

Hi all,

I would like to develop a module that periodically needs to fetch a file
from a remote site and update some data used by the child processes.  Is it
safe to create this thread in the post config hook?  I would like to do
something like:

Global thread fetches a file, and loads content
Thread signals that it has new data
A separate thread in each of the child processes gets the signal and updates
the cache in the child process.  The cache is only updated by this thread
and owned by the child process, so I lock it with a rwlock.  The cache is
read by request handlers, so I don't want to use a global lock since the
documentation implied it could be a performance issue.

Is this doable and which hooks / threading issues will I run into with this
approach?  It would be nice for the threads in the child process to be able
to concurrently read the data from the global thread after the global thread
has signaled new data is ready.  I did not see any type of global rw lock.



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