Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Subject: Re: cygserver cleanup thread From: bertrand marquis To: cygwin In-Reply-To: <20040811085049.GA1819@cygbert.vinschen.de> References: <1092212025 DOT 4338 DOT 11 DOT camel AT bma DOT sysgo DOT com> <20040811085049 DOT GA1819 AT cygbert DOT vinschen DOT de> Content-Type: text/plain; charset=UTF-8 Organization: SYSGO AG Message-Id: <1092214752.4338.15.camel@bma.sysgo.com> Mime-Version: 1.0 Date: 11 Aug 2004 10:59:12 +0200 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on donald.sysgo.com X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=no version=2.63 X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.16; AVE: 6.27.0.4; VDF: 6.27.0.4; host: mailgate.sysgo.de) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i7B8x7Bj024619 Le mer 11/08/2004 à 10:50, Corinna Vinschen a écrit : > On Aug 11 10:13, bertrand marquis wrote: > > Hello, > > > > i'm making a program using shared memory and as a consequence i need to > > use the cygserver. But when i close my program the ipcs give me this > > output: > > > > $ ipcs -ma > > Shared Memory: > > T ID KEY MODE OWNER GROUP CREATOR > > CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME > > m 262144 0 --rw------- bma Kein bma > > [...] > > > > In fact all the shared memory i used is still there and is used by > > nobody (NNATCH 0). I thought that the cleanup thread of the cygserver > > was supposed to clean those but i have to remove them myself. Is this a > > normal behavior ? Is there something to configure in cygserver to clean > > those ? > > This is normal behaviour. SYSV IPC is designed to keep the IPC elements > intact even if no process is accessing them. If you want to get rid of > them, then you have to do this by using the appropriate IPC_RMID control > call: > > msgctl (msgid, IPC_RMID, NULL); > semctl (semid, 0, IPC_RMID); > shmctl (shmid, IPC_RMID, NULL); > Thank you, i will try to find a way to call shmctl from the last thread running. > If you're creating an application which needs shared memory only on > runtime, which should disappear when the last application using it > exits, consider to use simple mmap calls. It's way easier than having > to run cygserver. > > > Corinna -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/