On Thu, Aug 22, 2002 at 02:38:50PM +0200, Sébastien Bonnegent wrote:
> sure, to lock the shared memory area, I have to use the apr_anylock_t 
> structure
> but I haven't found documentation on the different lock type...
> and it seems that this structure is not very used in the apache source...

There is only one type of shared memory in APR: apr_shm.h. It allows you
to request regions of shared memory to use between httpd children. If
you know the sizes of the structures you will store in there, you can
treat it like a big array or a big blob of memory. If OTOH you need to
do memory allocation and deallocation inside of that block, then you
can use the apr_rmm.h interface to manage that memory.

> Are there someone who know the different lock type ?

There are three types of locks. If you are using shared memory and
you want it to protect you whether you're using the prefork or worker
MPM, then the only one you should use is apr_global_mutex.h. The
apr_anylock_t structure is an abstraction of all the apr lock types,
and is only necessary for telling the apr_rmm.h interface how it
should protect its internal structures.

[If you have more questions, feel free to follow this up on the
dev@apr.apache.org list.]

-aaron

Reply via email to