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.

Thanks,

SB

Reply via email to