You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ian Holsman <ia...@cnet.com> on 2001/07/05 01:18:33 UTC
Shared Memory in APR
OK..
got a strange question...
I'm looking at the shared memory functions (in unix), and am struggling
to find out how one can attach to
a shared memory segment already created by another process.
I want to be able to create a a shared memory version of the hash table
which will be accessable all the processes
but can't seem to see a method to do this, unless I create the shared
mem before I fork and the shared memory variable is
available .
I can live with the above (creating the memory before I call fork) , but
was wondering if there was a better way (mmap'ed files perhaps)
Re: Shared Memory in APR
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Jul 04, 2001 at 04:41:02PM -0700, rbb@covalent.net wrote:
> Currently you can't, because MM doesn't really support it. We need to
> re-write the shared memory code, but it doesn't make a lot of sense to do
> that until the SMS stuff calms down.
Yeah, I was going to say about that same thing. Once the memory freaks
stop obessing over SMS, one of us is bound to look at shared memory. =)
I looked quickly at MM and a lot of their code is duplicated in other
parts of our code (i.e. locking), so it probably makes sense to just
take in the parts of MM that actually deal with shared memory,
and APRize the rest.
(I've been going over the SMS code all day...) -- justin
Re: Shared Memory in APR
Posted by dean gaudet <de...@arctic.org>.
On Wed, 4 Jul 2001 rbb@covalent.net wrote:
> On Wed, 4 Jul 2001, Ian Holsman wrote:
>
> > I'm looking at the shared memory functions (in unix), and am struggling
> > to find out how one can attach to
> > a shared memory segment already created by another process.
>
> Currently you can't, because MM doesn't really support it. We need to
> re-write the shared memory code, but it doesn't make a lot of sense to do
> that until the SMS stuff calms down.
MM doesn't support it because it's non-portable.
consider unix without sysvshm, posix shm, etc., but with anonymous shared
mmap(). anon shared mmap() doesn't require file backing -- it can live in
memory with no need to ever sync to disk. to support attach by other
(arbitrary) processes you need to have a backing file (handle for mmap()).
say bye bye to performance.
isn't this the case with various BSD-based systems?
-dean
Re: Shared Memory in APR
Posted by rb...@covalent.net.
On Wed, 4 Jul 2001, Ian Holsman wrote:
> OK..
> got a strange question...
>
> I'm looking at the shared memory functions (in unix), and am struggling
> to find out how one can attach to
> a shared memory segment already created by another process.
>
> I want to be able to create a a shared memory version of the hash table
> which will be accessable all the processes
> but can't seem to see a method to do this, unless I create the shared
> mem before I fork and the shared memory variable is
> available .
>
> I can live with the above (creating the memory before I call fork) , but
> was wondering if there was a better way (mmap'ed files perhaps)
Currently you can't, because MM doesn't really support it. We need to
re-write the shared memory code, but it doesn't make a lot of sense to do
that until the SMS stuff calms down.
Ryan
_____________________________________________________________________________
Ryan Bloom rbb@apache.org
Covalent Technologies rbb@covalent.net
-----------------------------------------------------------------------------