public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-developers@cygwin.com
Subject: Re: The unreliability of AF_UNIX datagram sockets
Date: Mon, 17 May 2021 09:02:13 -0400	[thread overview]
Message-ID: <06e013f9-b137-c6a2-8e5f-daaf88cee9e3@cornell.edu> (raw)
In-Reply-To: <YKJEwxSMOmAM1RAA@calimero.vinschen.de>

On 5/17/2021 6:26 AM, Corinna Vinschen wrote:
> On May 13 10:30, Ken Brown wrote:
>> While working on sendmsg, I thought of another useful thing that the mqueue
>> code could provide: an internal _mq_send function that returns EPIPE if no
>> one has the mqueue open for reading.  This plays the role of the
>> STATUS_PIPE_IS_CLOSED macro in the pipe implementation.
> 
> I don't see how to do that.  The code is written in a way not requiring
> to keep track of stuff at runtime.  All shared info is part of the mmap
> so far.  We don't know if any other mqd_t descriptor is open at the time,
> it's not even a descriptor in the usual sense, just a pointer to a private
> malloc'ed area.  Keeping track of open descriptors requires another
> shared mem region at runtime.

OK, then I think I can handle this in the AF_UNIX shared memory.  Each socket 
can keep track of its own number of open (socket) descriptors, and then it can 
send a shutdown message to its peer when the last one is about to close.  The 
sendmsg code will have to be tweaked to repeatedly check for shutdown messages.

Ken

  parent reply	other threads:[~2021-05-17 13:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 15:47 Ken Brown
2021-04-29 11:05 ` Corinna Vinschen
2021-04-29 11:16   ` Corinna Vinschen
2021-04-29 14:38   ` Ken Brown
2021-04-29 15:05     ` Corinna Vinschen
2021-04-29 15:18       ` Corinna Vinschen
2021-04-29 16:44       ` Ken Brown
2021-04-29 17:39         ` Corinna Vinschen
2021-05-01 21:41           ` Ken Brown
2021-05-03 10:30             ` Corinna Vinschen
2021-05-03 15:45               ` Corinna Vinschen
2021-05-03 16:56                 ` Ken Brown
2021-05-03 18:40                   ` Corinna Vinschen
2021-05-03 19:48                     ` Ken Brown
2021-05-03 20:50                       ` Ken Brown
2021-05-04 11:06                         ` Corinna Vinschen
2021-05-13 14:30                           ` Ken Brown
2021-05-17 10:26                             ` Corinna Vinschen
2021-05-17 13:02                               ` Ken Brown
2021-05-17 13:02                               ` Ken Brown [this message]
2021-05-20 13:46   ` Ken Brown
2021-05-20 19:25     ` Corinna Vinschen
2021-05-21 21:54       ` Ken Brown
2021-05-22 15:49         ` Corinna Vinschen
2021-05-22 16:50           ` Ken Brown
2021-05-22 18:21             ` Ken Brown

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=06e013f9-b137-c6a2-8e5f-daaf88cee9e3@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-developers@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).