bug-gnulib
[Top][All Lists]
Advanced

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

Re: Portabilty of poll trick


From: Bruno Haible
Subject: Re: Portabilty of poll trick
Date: Fri, 14 May 2021 12:43:13 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; )

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




reply via email to

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