Re: Portabilty of poll trick

2021-05-14 Thread Bruno Haible
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

Re: Portabilty of poll trick

2021-04-28 Thread Bastien ROUCARIES
Le mar. 27 avr. 2021 à 22:51, Ben Pfaff a écrit : > > On Tue, Apr 27, 2021 at 3:47 PM Bastien ROUCARIES > wrote: > > > > Le mar. 27 avr. 2021 à 22:40, Bruno Haible a écrit : > > > > > > Hi Bastien, > > > > > > > I want to assess the safety and portability of the following trick, > > > > > > I wo

Re: Portabilty of poll trick

2021-04-27 Thread Ben Pfaff
On Tue, Apr 27, 2021 at 3:47 PM Bastien ROUCARIES wrote: > > Le mar. 27 avr. 2021 à 22:40, Bruno Haible 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: > > -

Re: Portabilty of poll trick

2021-04-27 Thread Bastien ROUCARIES
Le mar. 27 avr. 2021 à 22:40, Bruno Haible 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 multi

Re: Portabilty of poll trick

2021-04-27 Thread Bruno Haible
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? - Why is it a "trick"? What advantages does it have compared to the code a naïve developer would writ

Portabilty of poll trick

2021-04-27 Thread Bastien Roucariès
Hi, I want to assess the safety and portability of the following trick, for getting outside poll. Replacing by using dup2 a read poll object by a writtable one. I think to use this for stopping polling in multithread program It work really well, and could for instance allow me to tear down event