public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Persistence of file implemented objects
Date: Mon, 02 Jul 2012 08:03:00 -0000	[thread overview]
Message-ID: <20120702080303.GA17618@calimero.vinschen.de> (raw)
In-Reply-To: <4FF0942B.1030201@gmail.com>

On Jul  1 19:17, Richard H Lee wrote:
> >Fifos persist on reboot on Linux or Cygwin.  They live on the
> >filesystem.  I don't see how POSIX IPC shared memory and semaphores
> >could persist.
> 
> Sorry, I meant unix/bsd sockets.

AF_UNIX/AF_LOCAL sockets are implemented on filesystem level as well,
not only on Cygwin.  If they are not explicitely unlinked, they will be
in the way when trying to create a new socket of the same name.

> Regarding the POSIX IPC's, they are stored in /dev . In regular
> *nix, /dev do not represent "physical" files on the filesystem,
> hence they do not persist over boot.
> 
> In cygwin, they actually do represent physical files. So if they are
> not freed correctly by the program, the persist over to the next
> boot.

Right.  The named POSIX IPC objects are created as normal files under
/dev/shm and /dev/mqueue.  These objects are supposed to follow POSIX
file name naming rules, and they are supposed to be persistent until you
call mq_unlink, sem_unlink, or shm_unlink respectively.  They are also
meant to persist if a process crashes(*).

So in contrast to XSI IPC implemented by running cygserver they also
persist when all Cygwin processes have stopped and even over reboot,
because they don't live on a virtual filesystem like on Linux, but on
the real filesystem.

From the POSIX point of view that's ok.  If you have a problems with
that, you might consider to create some autostart script which deletes
all files below /dev/shm and /dev/mqueue.


Corinna


(*) See http://pubs.opengroup.org/onlinepubs/007908799/xsh/mq_open.html
        http://pubs.opengroup.org/onlinepubs/007908799/xsh/sem_open.html
	http://pubs.opengroup.org/onlinepubs/007908799/xsh/shm_open.html

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      parent reply	other threads:[~2012-07-02  8:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-30 22:29 Richard H Lee
2012-07-01  0:35 ` Christopher Faylor
2012-07-01 18:17   ` Richard H Lee
2012-07-01 23:35     ` Christopher Faylor
2012-07-02  8:03     ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120702080303.GA17618@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).