Message137361
Using signalfd() (require Linux 2.6.22+), specified signals are written in a file and don't interrupt system calls (select). Bonus: we can wait for a signal using select!
Using pthread_sigmask(), you can also block signals before calling select, but it's not atomic. Or you can use pselect() which is pthread_sigmask()+select() in an atomic fashion.
pthread_sigmask() is already in Python 3.3, I plan to add signalfd() in a few weeks into Python 3.3. For pselect(), I don't know if we need it.
pthread_sigmask() is available on most POSIX systems, not on Windows. Can select() be interrupted by CTRL+c on Windows?
I don't say that we should not restart manually select() on EINTR, just that better solutions do exist today. |
|
Date |
User |
Action |
Args |
2011-05-31 14:55:26 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, spiv, exarkun, pitrou, Christophe Simonis, nvetoshkin, neologix, Yaniv.Aknin, bda, kchen |
2011-05-31 14:55:26 | vstinner | set | messageid: <1306853726.67.0.430051547505.issue7978@psf.upfronthosting.co.za> |
2011-05-31 14:55:26 | vstinner | link | issue7978 messages |
2011-05-31 14:55:26 | vstinner | create | |
|