From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,135fd1567ee95fcf X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-15 09:07:11 PST Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!dsinc!spool.mu.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!nigel.msen.com!math.fu-berlin.de!zib-berlin.de!irz401!irzr17!beck From: beck@irzr17.inf.tu-dresden.de (Andre Beck) Newsgroups: comp.unix.osf.osf1 Subject: Re: Problems with semaphores and shared memory segments Date: 15 Mar 1994 18:07:11 +0100 Organization: Dept. of Computer Science, TU Dresden, Germany. Distribution: world Message-ID: <2m4pvv$13j0@irzr17.inf.tu-dresden.de> References: <2l5433$i11@explorer.clark.net> Reply-To: Andre_Beck@IRS.Inf.TU-Dresden.DE NNTP-Posting-Host: irzr17.inf.tu-dresden.de 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-+