bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portabilty of poll trick


From: Ben Pfaff
Subject: Re: Portabilty of poll trick
Date: Tue, 27 Apr 2021 15:51:29 -0700

On Tue, Apr 27, 2021 at 3:47 PM Bastien ROUCARIES
<roucaries.bastien@gmail.com> wrote:
>
> 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...

Can you use socketpair() instead of pipe()?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]