httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Apache2 Shared Memory problem
Date Sun, 11 Feb 2007 13:57:12 GMT
On Sun, 11 Feb 2007 13:46:11 +0100
"Aron Szabo" <aronsza@gmail.com> wrote:

> Hello!
> 
> I`m wrtiting a vhost module for apache2.

This should really be on the modules list.

> I need an array or a hash or an apache table to be WRITABLE/READABLE
> from every apache child.
> This vhost module is a modified version of vhost-mysql . But I dont
> want to do an sql query on every request so i want to cache it after
> the request in an apache table (vhost; path) or a hash or something.

From that description (which you didn't give on IRC), you're probably
better off forgetting about shared memory, and using a per-process
cache (with any permanent changes going to the database, of course).

From what you said on IRC, you've already tried apr_shm.
That's no use for pointers when dereferencing them takes you
out of shared memory.  You could add apr_rmm to give you
pointers, but that still doesn't give you the higher-level
structs (like array or hash).  For that you'd need a shared
memory pool, which you might get by implementing a new
apr_allocator on top of apr_shm/apr_rmm.

If that was an attractive option, I expect someone would have
done it already.  I already mentioned the easier alternatives
on IRC.


-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Mime
View raw message