Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Problems with semaphores and shared memory segments
@ 1994-03-03 16:43 Jody C. Patilla
  1994-03-09 15:54 ` Christian Rang
  1994-03-15 17:07 ` Andre Beck
  0 siblings, 2 replies; 3+ messages in thread
From: Jody C. Patilla @ 1994-03-03 16:43 UTC (permalink / raw)



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?


-- 

jcpatilla					jcp@clark.net

"Fling your beavers aloft!"


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems with semaphores and shared memory segments
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Rang @ 1994-03-09 15:54 UTC (permalink / raw)


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?

No, this is not a bug. The System V semantics of message queues, shared
memory and semaphores explicitely state that they remain after the
process exits, normally or abnormally.

Personally , I don't like this behaviour. For instance, I find OS/2's
queue management much easier to use because there, queues are
automagically removed when the owning process dies.




--
Christian Rang, Fraunhofer-Institut IPK, Berlin (rang@ipk.fhg.de)
#include <universe/milkyway/solarsys/earth/germany/fraunhofer/ipk/disclaimer.h>
-------------------------------------------------------------------------------
Practical Electrical Engineering: "Data, I need more light!" - Beverly Crusher


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems with semaphores and shared memory segments
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Andre Beck @ 1994-03-15 17:07 UTC (permalink / raw)



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-+


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1994-03-15 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox