[ELDK] Posix Shared Memory

Markus Klotzbücher mk at denx.de
Fri May 23 16:54:16 CEST 2008

Hi Detlev,

Detlev Zundel <dzu at denx.de> writes:

>> "Daniel Stonier" <d.stonier at gmail.com> writes:
>>> In your experience, is there any reason to favour SYSV over Posix? We
>>> only chose posix keeping in mind that we may wish to port to QNX in the
>>> future.
>> Good question. SYSV is a lot heavier than POSIX shared memory and has
>> some features that POSIX hasn't (get number of attached processes).
>> Nevertheless i would choose the POSIX variant because shared memory
>> objects are files that can be addressed through the file system instead
>> of their own namespace(ftok, ipcs(1) ...)
> The SystemV IPC calls are really going out of use.  The main reason is
> that they do not fit into the Unix mind set.  For one, they do not yield
> file descriptors that can for example be passed to select (only relevant

Yes, agreed.

> for message queues).  The other is that they have _persistent_
> ressources, like global variables something one should not use
> lightheartedly.

I think this is true for Posix IPC too, for example sem_overview(7)

       POSIX named semaphores have kernel persistence: if not removed by
       sem_unlink(3), a semaphore will exist until the system is shut

Same applies to shared mem, the shared memory file in /dev/shm/ exists
until shm_unlink'ed.

Best regards

Markus Klotzbücher

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

More information about the eldk mailing list