You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Ray Morris <su...@bettercgi.com> on 2007/08/03 23:54:24 UTC

shared table (create a pool from a block of memory?)

    We would like to use an APR table to share
data between processes or threads where the data
is a buit more than one would want to manage
in a raw block of shared memory.  Searching this
list, on Google, and looking through the source
I've found several people wanting to do soemthing
similar, and some answers on how to get a block of
raw shared memory that could be used to share
something simple like a single integer.

    More complex data needs to be held in a structure
like a table, though.  I see no function to create a
table from raw memory, only from a pool.  Perhaps there
is some function that create a pool from a chunk of memory
that I'm not finding?  That is to say, something that
could be used like this:

void *memory;
apr_pool_t * newpool;

memory = malloc(BIG_CHUNK);
apr_pool_create_from_memory(&newpool, memory);

    It seems to me that if there is some function to
create a pool from memory, that would mean that creating
the pool from SHARED memory would result in a SHARED
pool, from which we could create all kinds of shared
structures - shared tables or anything else that needed
to be shared.  Any ideas?  Thanks.
--
Ray B. Morris
support@bettercgi.com

Re: shared table (create a pool from a block of memory?)

Posted by Joachim Zobel <jz...@heute-morgen.de>.
Am Freitag, den 03.08.2007, 16:54 -0500 schrieb Ray Morris:
> 
>     More complex data needs to be held in a structure
> like a table, though.  

If you need a shared table consider using a relational database. It is
much more scaleable, it handles concurreny and it is probably faster
than you think.

http://httpd.apache.org/docs/2.2/mod/mod_dbd.html

Sincerely,
Joachim