You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Tahiry Ramanamampanoharana <no...@hotmail.com> on 2002/06/18 15:34:07 UTC

Modified apr_hash

Hi guys,

Recently I was writing an Apache module and I needed a hash table library 
using shared memory. I wanted a hash table that could be shared among 
children processes (read/write access) and not only the usual parent to 
children.

So I wrote my own shared mem library that uses the actual apr_shm lib.
Then, since I didn't want to write my own hash table lib, I modified the 
current APR hash lib to be more generic by removing its dependency to APR 
pool.

Instead of explicitly using pools, I modified it so that you register your 
own memory allocation function and make APR hash functions use it. This 
enables me to have a shared memory hash table with APR hash lib.

So for those who might need it, I am attaching 3 libs with this email:
- apr_hash.c & apr_hash.h: the modified (reverse compatible with current use 
of the library)
- my_shmem.c & my_shmem.h: child to child shared memory
- my_shmem_hash.c & my_shmem_hash.h: hash table using my_shmem instead of 
APR pools.

I might be totally wrong on the usefulness of this, as this is the first I 
am getting at this kind of stuff. Feedbacks will be highly appreciated.

Tahiry



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

Re: Modified apr_hash

Posted by Bill Stoddard <bi...@wstoddard.com>.
Forwarding to dev@apr... Hit send a bit too quickly...

Bill

> Thanks. Don't have time to look at this now, but I did spend the time to de-pool
apr_hash
> for use by mod_mem_cache (see modules/experimental/cache_hash.c).  Some of us are
> interested in making mod_mem_cache work in shared mem so your code may do the trick...
>
> Bill
>
> ----- Original Message -----
> From: "Tahiry Ramanamampanoharana" <no...@hotmail.com>
> To: <de...@apr.apache.org>
> Sent: Tuesday, June 18, 2002 9:34 AM
> Subject: Modified apr_hash
>
>
> > Hi guys,
> >
> > Recently I was writing an Apache module and I needed a hash table library
> > using shared memory. I wanted a hash table that could be shared among
> > children processes (read/write access) and not only the usual parent to
> > children.
> >
> > So I wrote my own shared mem library that uses the actual apr_shm lib.
> > Then, since I didn't want to write my own hash table lib, I modified the
> > current APR hash lib to be more generic by removing its dependency to APR
> > pool.
> >
> > Instead of explicitly using pools, I modified it so that you register your
> > own memory allocation function and make APR hash functions use it. This
> > enables me to have a shared memory hash table with APR hash lib.
> >
> > So for those who might need it, I am attaching 3 libs with this email:
> > - apr_hash.c & apr_hash.h: the modified (reverse compatible with current use
> > of the library)
> > - my_shmem.c & my_shmem.h: child to child shared memory
> > - my_shmem_hash.c & my_shmem_hash.h: hash table using my_shmem instead of
> > APR pools.
> >
> > I might be totally wrong on the usefulness of this, as this is the first I
> > am getting at this kind of stuff. Feedbacks will be highly appreciated.
> >
> > Tahiry
> >
> >
> >
> > _________________________________________________________________
> > MSN Photos is the easiest way to share and print your photos:
> > http://photos.msn.com/support/worldwide.aspx
> >
>


Re: Modified apr_hash

Posted by Bill Stoddard <bi...@wstoddard.com>.
Forwarding to dev@apr... Hit send a bit too quickly...

Bill

> Thanks. Don't have time to look at this now, but I did spend the time to de-pool
apr_hash
> for use by mod_mem_cache (see modules/experimental/cache_hash.c).  Some of us are
> interested in making mod_mem_cache work in shared mem so your code may do the trick...
>
> Bill
>
> ----- Original Message -----
> From: "Tahiry Ramanamampanoharana" <no...@hotmail.com>
> To: <de...@apr.apache.org>
> Sent: Tuesday, June 18, 2002 9:34 AM
> Subject: Modified apr_hash
>
>
> > Hi guys,
> >
> > Recently I was writing an Apache module and I needed a hash table library
> > using shared memory. I wanted a hash table that could be shared among
> > children processes (read/write access) and not only the usual parent to
> > children.
> >
> > So I wrote my own shared mem library that uses the actual apr_shm lib.
> > Then, since I didn't want to write my own hash table lib, I modified the
> > current APR hash lib to be more generic by removing its dependency to APR
> > pool.
> >
> > Instead of explicitly using pools, I modified it so that you register your
> > own memory allocation function and make APR hash functions use it. This
> > enables me to have a shared memory hash table with APR hash lib.
> >
> > So for those who might need it, I am attaching 3 libs with this email:
> > - apr_hash.c & apr_hash.h: the modified (reverse compatible with current use
> > of the library)
> > - my_shmem.c & my_shmem.h: child to child shared memory
> > - my_shmem_hash.c & my_shmem_hash.h: hash table using my_shmem instead of
> > APR pools.
> >
> > I might be totally wrong on the usefulness of this, as this is the first I
> > am getting at this kind of stuff. Feedbacks will be highly appreciated.
> >
> > Tahiry
> >
> >
> >
> > _________________________________________________________________
> > MSN Photos is the easiest way to share and print your photos:
> > http://photos.msn.com/support/worldwide.aspx
> >
>


Re: Modified apr_hash

Posted by Bill Stoddard <bi...@wstoddard.com>.
Thanks. Don't have time to look at this now, but I did spend the time to de-pool apr_hash
for use by mod_mem_cache (see modules/experimental/cache_hash.c).  Some of us are
interested in making mod_mem_cache work in shared mem so your code may do the trick...

Bill

----- Original Message -----
From: "Tahiry Ramanamampanoharana" <no...@hotmail.com>
To: <de...@apr.apache.org>
Sent: Tuesday, June 18, 2002 9:34 AM
Subject: Modified apr_hash


> Hi guys,
>
> Recently I was writing an Apache module and I needed a hash table library
> using shared memory. I wanted a hash table that could be shared among
> children processes (read/write access) and not only the usual parent to
> children.
>
> So I wrote my own shared mem library that uses the actual apr_shm lib.
> Then, since I didn't want to write my own hash table lib, I modified the
> current APR hash lib to be more generic by removing its dependency to APR
> pool.
>
> Instead of explicitly using pools, I modified it so that you register your
> own memory allocation function and make APR hash functions use it. This
> enables me to have a shared memory hash table with APR hash lib.
>
> So for those who might need it, I am attaching 3 libs with this email:
> - apr_hash.c & apr_hash.h: the modified (reverse compatible with current use
> of the library)
> - my_shmem.c & my_shmem.h: child to child shared memory
> - my_shmem_hash.c & my_shmem_hash.h: hash table using my_shmem instead of
> APR pools.
>
> I might be totally wrong on the usefulness of this, as this is the first I
> am getting at this kind of stuff. Feedbacks will be highly appreciated.
>
> Tahiry
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>