delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/11/04:59:09

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <bertrand DOT marquis AT sysgo DOT com>
To: cygwin <cygwin AT cygwin DOT com>
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>
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)
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019