Message223148
(1) the thread B gets the SIGCHLD signal: it writes a byte into the "self" pipe of the event loop
C signal_handler: sig_num=20, thread=34468857856
trip_signal(20): write()
(2) in the main thread, the event loop is awaken by the write in the pipe... but there is nothing to do
_read_from_self -> b'\x14', thread=34384933888
(3) the thread B schedules the callback
Py_AddPendingCall(checksignals_witharg), thread=34468857856
(I modified the output a little bit for readability.)
IMO the problem is that asyncio relies on two events:
* signal number written in the "self" pipe of the event loop
* callback scheduled by the C handler
A solution would be to schedule the callback in the event loop. Since Python 3.3, the C signal handler writes the signal number, which should be enough to find and schedule the Python callback. |
|
Date |
User |
Action |
Args |
2014-07-15 20:54:03 | vstinner | set | recipients:
+ vstinner, gvanrossum, pitrou, giampaolo.rodola, python-dev, yselivanov |
2014-07-15 20:54:03 | vstinner | set | messageid: <1405457643.55.0.112883233397.issue21645@psf.upfronthosting.co.za> |
2014-07-15 20:54:03 | vstinner | link | issue21645 messages |
2014-07-15 20:54:03 | vstinner | create | |
|