Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: beck@irzr17.inf.tu-dresden.de (Andre Beck)
Subject: Re: Problems with semaphores and shared memory segments
Date: 15 Mar 1994 18:07:11 +0100	[thread overview]
Message-ID: <2m4pvv$13j0@irzr17.inf.tu-dresden.de> (raw)
In-Reply-To: 2l5433$i11@explorer.clark.net


In article <2l5433$i11@explorer.clark.net>, jcp@clark.net (Jody C. Patilla) writes:
|>
|>We have observed a problem in using semaphores and shared memory segments,
|>in that the semaphores are hanging around after the process using them 
|>dies - the system is not cleaning up after itself. It is our understanding
|>that the semaphore should only remain as long as there is a process open
|>for writing against it. Is this a bug, or are we missing something here?
|>

All the objects of SYSV IPC, i.e. shared memory segments, semaphores and
message queues are persistent. You HAVE to remove them with the appropriate
system call (f.i. semctl(semid, IPC_RMID); ) to get rid of them.
However, the behavior of the objects is clean, i.e. a process's allocation
of semaphore units gets removed when it exits, and a shared memory segment
which is removed gets physically to dead when the last mapping process ends.

If you find lots of lost ipc objects hanging around, you may use ipcrm
to get rid of them, however it's the job of the using processes (as long
as kill -9 is not used :)
--
+-o-+--------------------------------------------------------+-o-+
| o |		    \\\- Brain Inside -///		     | o |
| o |			^^^^^^^^^^^^^^			     | o |
| o | Andre' Beck (ABPSoft) Andre_Beck@IRS.Inf.TU-Dresden.de | o |
+-o-+--------------------------------------------------------+-o-+


      parent reply	other threads:[~1994-03-15 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-03-03 16:43 Problems with semaphores and shared memory segments Jody C. Patilla
1994-03-09 15:54 ` Christian Rang
1994-03-15 17:07 ` Andre Beck [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox