in reply to "self-pipe trick" needed with perl?

It seems to say that it's possible for select not to return (with EINTR or otherwise) on SIGCHLD. If that's true, then yes, it affects Perl. Keep in mind the reference was written in 1992, a lifetime ago, so it may no longer apply.

Note that the self-pipe trick won't work in Perl (when using safe signals). The signal handler can't cause select to return because the signal handler only get executed after select returns.

Replies are listed 'Best First'.
Re^2: "self-pipe trick" needed with perl?
by perl5ever (Pilgrim) on Jun 07, 2011 at 20:45 UTC
    Does/could perl use pselect instead of select where it is available?

      The man page for select/pselect provides more info than your original link.

      Suppose the signal handler sets a global flag and returns. Then a test of this global flag followed by a call of select() could hang indefinitely if the signal arrived just after the test but just before the call.

      This is exactly what Perl does.

      By contrast, pselect() allows one to first block signals, handle the signals that have come in, then call pselect() with the desired sigmask, avoiding the race.

      Perl could do this. It could even use the self-pipe trick internally on systems that don't have pselect.

      My machine supports pselect based on the presence of its man page, but strace shows neither pselect nor a pipe.

      Feel free to submit a bug report.