On 01/05/10 23:03, Samuel K. Gutierrez wrote:

> I call shmctl IPC_RMID immediately after one process has
> attached to the segment because, at least on Linux, this
> only marks the segment for destruction.

That's correct, looking at the kernel code (at least in the
current git master) the function that handles this - do_shm_rmid()
in ipc/shm.c - only destroys the segment if nobody is attached
to it, otherwise it marks the segment as IPC_PRIVATE to stop
others finding it and with SHM_DEST so that it is automatically
destroyed on the last detach.

cheers,
Chris
--
  Christopher Samuel - Senior Systems Administrator
  VLSCI - Victorian Life Sciences Computational Initiative
  Email: samuel@unimelb.edu.au Phone: +61 (0)3 903 55545
          http://www.vlsci.unimelb.edu.au/