httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: Shared memory
Date Thu, 23 Nov 2006 15:50:52 GMT

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 
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  


Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

View raw message