bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Cc: Erik Blake <eblake@redhat.com>, bug-gnulib <bug-gnulib@gnu.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: Portabilty of poll trick
Date: Fri, 14 May 2021 12:43:13 +0200	[thread overview]
Message-ID: <2934918.8a3MQ3Grrs@omega> (raw)
In-Reply-To: <CAE2SPAa88M6LJ+1mQ_d840f69RynkOdg-UsosTDWV=wkrVCXbg@mail.gmail.com>

Bastien ROUCARIES wrote:
> - close the end of the pipe, but it does not break poll(2), and
> moreover in multithread context
> it is not safe due to fd reuse

Yes, close() in multithreaded applications needs to be done carefully,
to avoid that unintended operations get done to the next file that
is connected to the same file descriptor. However, I don't see how
a library / abstraction can help here. It's just careful coding of
the application that is needed.

Bruno



      parent reply	other threads:[~2021-05-14 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  7:14 Portabilty of poll trick Bastien Roucariès
2021-04-27 22:40 ` Bruno Haible
2021-04-27 22:46   ` Bastien ROUCARIES
2021-04-27 22:51     ` Ben Pfaff
2021-04-28 15:43       ` Bastien ROUCARIES
2021-05-14 10:43     ` Bruno Haible [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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=2934918.8a3MQ3Grrs@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eblake@redhat.com \
    --cc=mtk.manpages@gmail.com \
    --cc=roucaries.bastien@gmail.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).