Hmm ... yes the shm way is too complicated for me :/ I will use apr_dbm (which you already mentioned)
"(10:35:51 AM) niq: use apr_dbm or apr_memcache" Thanks again! Yours, Aron On 2/11/07, Nick Kew <[EMAIL PROTECTED]> wrote:
On Sun, 11 Feb 2007 13:46:11 +0100 "Aron Szabo" <[EMAIL PROTECTED]> 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/
