You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Imran S. Patel" <im...@cs.ucsb.edu> on 2003/05/14 03:46:05 UTC
Global pool and shared memory for modules
Hi all,
I am writing an Apache 2 module and so far things have been progressing
very nicely, thanks to the nice API and the wonderfully designed APR
libraries. However, I was tripped up by the usage of global data
structures in my module. The problem that I later discovered was that
merely making variables global or allocating stuff from the pconf pool
doesn't make things "module-wide" global. So my question is:
How do I share a global hash-table or a counter or anything across all
instances of my module in a portable manner?
Also, I looked at the shared memory facility provided by APR. But even if
I use shared memory, from which pool do I allocate the apr_shm_t structure
and how do i destroy the shared memory in a safe manner later on?
Is there any documentation/"simple" module which does this or explain
apache module behavior under different MPMs?
Lots of questions, i guess! :)
TIA
imran
-------------------------------------------------------------------------------
A witty saying proves nothing.
-- Voltaire