Antoine Pitrou <pit...@free.fr> added the comment:

Also see how the forkserver module does without it:
https://github.com/python/cpython/blob/master/Lib/multiprocessing/forkserver.py#L146

Reading Jean-Paul's messages in https://bugs.python.org/issue8407, I'm unclear 
what is required to take advantage of signalfd().  Jean-Paul says """In order 
to effectively use signalfd(), the signals in question must be blocked, 
though""".  The signalfd man page says:

"""Normally, the set of signals to  be  received  via the  file descriptor 
should be blocked using sigprocmask(2), to prevent the signals being handled 
according to their default dispositions""".

And it's not clear what is meant by that (what happens if you don't block those 
signals?). Also:

"""As a consequence of the read(2), the signals are consumed, so that they are 
no longer pending for the process (i.e., will not be caught by signal handlers, 
and cannot be accepted using sigwaitinfo(2))."""

But how about the converse?  i.e. can a signal be consumed first by a signal 
handler and the fd not written to at all?

Also see fork() semantics which might (or not) require special handling.

Also see https://bugs.python.org/issue31489 for an issue related to fork(), 
signals and fds.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to