httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zaid Amireh <>
Subject Re: Sharing information between threads and processes.
Date Sun, 31 Jul 2011 19:50:58 GMT
On Jul 22, 2011, at 12:40 PM, Ignaz Birnstingl wrote:

> I implemented something very similar for my module: Dynamic
> configuration data is retrieved from a remote server and should be
> shared among all worker processes. Fortunately the configuration
> changes only sporadically so I implemented it using
> serialization/deserialization to/from the shared memory segment. Of
> course inter-process locking must be considered - for example using
> apr_proc_mutex_* or a spinlock inside the shared memory segment.
> -- Ignaz

Thank you all for your suggestions, it turns out that implementing a shared dynamic memory
storage across all the threads and process is quite a complex process, I ended up doing it
in a stand alone daemon that uses libevent, each apache process or thread has its own storage
for the duration of its life and all the cache misses are looked up in the said daemon using
TCP sockets, the daemon usually replies in 0.004 seconds which is an acceptable performance
hit since mutex locking across all apache instances might have ended up with a larger overhead
anyway on busy servers.

virtually yours

View raw message