From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Bruno Haible <bruno@clisp.org>
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: Tue, 27 Apr 2021 22:46:31 +0000 [thread overview]
Message-ID: <CAE2SPAa88M6LJ+1mQ_d840f69RynkOdg-UsosTDWV=wkrVCXbg@mail.gmail.com> (raw)
In-Reply-To: <1632993.5ns3uf8gxi@omega>
Le mar. 27 avr. 2021 à 22:40, Bruno Haible <bruno@clisp.org> a écrit :
>
> Hi Bastien,
>
> > I want to assess the safety and portability of the following trick,
>
> I would want to help you with this, but I can't. You have not stated:
> - What is this code supposed to do?
I want to shutdown (2) a pipe, in a multithread application, in order
to get out a poll(2) wait state
> - Why is it a "trick"? What advantages does it have compared to the code
> a naïve developer would write?
The naive delevopper will:
- 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
-use timeout but in this case why use poll...
The goal is also to shutdown an eventfd but without kernel support, I
suppose it is not possible...
Bastien
>
>
>
> > for getting outside poll.
>
> I don't understand what you mean here.
>
> Bruno
>
next prev parent reply other threads:[~2021-04-27 22:47 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 [this message]
2021-04-27 22:51 ` Ben Pfaff
2021-04-28 15:43 ` Bastien ROUCARIES
2021-05-14 10:43 ` Bruno Haible
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='CAE2SPAa88M6LJ+1mQ_d840f69RynkOdg-UsosTDWV=wkrVCXbg@mail.gmail.com' \
--to=roucaries.bastien@gmail.com \
--cc=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=eblake@redhat.com \
--cc=mtk.manpages@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).