httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Some Guy <teknos...@gmail.com>
Subject Process lifetime and hooks to use
Date Fri, 16 Apr 2010 19:51:40 GMT
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

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