Anil
2005-01-06 23:33:45 UTC
Hi All,
Posix shared memory implementation provides the shm_open and shm_unlink
methods to create and detact/delete the shared memory.
shm_unlink detacts from the shared memory segment and if the reference
count for that segment is zero it automatically deletes it.
But I kind of see this as a resistriction as compared to the system
defined shared memory, where you explicity detach from the shared
memory and delete the shared memory.
Posix is giving me resistriction in situation where one process creates
a shared memory and fills some data and goes out of scope. At a later
time, some other process comes up attaches to this shared memory and
reads the values. With the reference count resistriction in posix,
atleast one process should be attached to the shared memory for it be
existing.
Can anyone suggest a way where we can keep the shared memory in posix
even if there is no process attached to it.
Regards
Posix shared memory implementation provides the shm_open and shm_unlink
methods to create and detact/delete the shared memory.
shm_unlink detacts from the shared memory segment and if the reference
count for that segment is zero it automatically deletes it.
But I kind of see this as a resistriction as compared to the system
defined shared memory, where you explicity detach from the shared
memory and delete the shared memory.
Posix is giving me resistriction in situation where one process creates
a shared memory and fills some data and goes out of scope. At a later
time, some other process comes up attaches to this shared memory and
reads the values. With the reference count resistriction in posix,
atleast one process should be attached to the shared memory for it be
existing.
Can anyone suggest a way where we can keep the shared memory in posix
even if there is no process attached to it.
Regards