[issue1583] Patch for signal.set_wakeup_fd

Adam Olsen report at bugs.python.org
Tue Apr 9 14:55:56 EDT 2019


Adam Olsen <rhamph at gmail.com> added the comment:

Disagree; if you're writing signal-handling code you should be very careful to do it properly, even if that's only proper for your current platform.  If you can't do it properly you should find an alternative that doesn't involve signals.

The fact that sig_atomic_t is only 1 byte on VxWorks strongly implies using int WILL fail in strange ways on that platform.  I can see three options:

1) use pycore_atomic.h, implementing it for VxWorks if you haven't already.  This also implies sig_atomic_t could have been int but wasn't for some reason, such as performance.
2) disable wakeup_fd entirely.  It's obscure, GNOME being the biggest user I can think of.
3) unpack the int into an array of sig_atomic_t.  Only the main thread writes to it so this method is ugly but viable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1583>
_______________________________________


More information about the Python-bugs-list mailing list