Christiaan,

On Nov 22, 2006, at 12:12 PM, Christiaan Lamprecht wrote:

I'm trying to share some WRITABLE memory between apache requests...
This means that I'll need to use APR mutex's and the like but can
anyone suggest where the best place is to store such writable data.
(short of having to write it to a file, I'm looking for something less
costly) Is the module's server/directory config space appropriate to
write to at runtime?

You can use shared memory. Back in the dark days of Apache 1.3, you had to use MM or do something platform-specific. Now, APR offers a shared memory implementation that will make a read/write block available to all httpd children.

You might take a look at http://www.temme.net/sander/ mod_example_ipc/ , a very bare bones example of a counter maintained between httpd children and requests.

I'm using apr_global_mutex_t. If your httpd is not threaded, and APR is compiled with --disable-threads, its behaviour reverts to apr_proc_mutex_t.

S.


--
[EMAIL PROTECTED]            http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to