httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oğuzhan TOPGÜL <>
Subject Re: Binary Tree Shared Memory Problem
Date Mon, 28 Nov 2011 22:29:20 GMT
Hi, is there any example mod_slotmem codes that we can understand the
usage? Or could you give me an usage example? For example we are using
apr_shm_create() in post_config, but mod_slotmem is a little bit hard to
understand i think.
And i want to ask a question,
is it a problem to create

typedef struct node {
    ELEMENT node_element;
    struct node *left;
    struct node *right;

kind of struct. A struct that has two struct elements. As i mentioned
before what i'm trying to implement is a binary tree as a data structure.


Oğuzhan TOPGÜL

On Mon, Nov 28, 2011 at 11:52 PM, Ignaz Birnstingl <> wrote:

> Hi,
> apr_shm_baseaddr_get returns the base address for the shared memory
> segment. You will have to implement your own "allocator" within the shared
> memory. Also keep in mind that you can't reliably use pointers inside the
> shared memory segment, because - as the documentation states - the address
> returned by apr_shm_baseaddr_get "is only usable within the callers address
> space, since this API does not guarantee that other attaching processes
> will maintain the same address mapping."
> Inter- and intra-process synchronization will be problems you will
> encounter later on.
> Btw Apache 2.3 offers mod_slotmem which helps in using shared memory -
> maybe you should have a look at it?
> -- Ignaz

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message