Re: shmget vs. shm_open
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 11/18/05
- Next message: Kasper Dupont: "Re: shared memory problemens"
- Previous message: Phil Frisbie, Jr.: "Re: how to implement "critical section"?"
- In reply to: bill pursell: "shmget vs. shm_open"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Nov 2005 18:09:56 +0100
bill pursell wrote:
>
> Can anyone point me to a comparison of using sysVr4 shmget() calls
> versus Posix shm_open()? Is there a reason (other than wanting to
> conform to one standard vs. the other) to choose one over the other?
> If my app is only going to be running on Linux, does it matter which
> style of shared memory I choose to use?
I think Posix shared memory is more convenient. The API
is essentially the same as with memory mapped files, and
the semantics are also the same. Posix shared memory
also allows you to easilly map a part of a shared memory
segment, something which SysV shared memory does not.
And AFAIK only Posix shared memory have a clear semantics
in case you delete a shared memory segment while it is
still mapped. This is something one needs to do in order
to avoid leaks in case of unexpected termination.
-- Kasper Dupont Note to self: Don't try to allocate 256000 pages with GFP_KERNEL on x86.
- Next message: Kasper Dupont: "Re: shared memory problemens"
- Previous message: Phil Frisbie, Jr.: "Re: how to implement "critical section"?"
- In reply to: bill pursell: "shmget vs. shm_open"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|