Message305766
>> I think we should update `Future._schedule_callbacks` to check if the loop is in debug mode.
> Unfortunately this is not sufficient for the snippet I posted. The loop's thread_id is only set when the loop runs, but the main loop in that example never runs.
If the loop isn't running, call_soon works just fine from any thread.
call_soon_threadsafe is different from call_soon when the loop *is* running. When it's running and blocked on IO, call_soon_threadsafe will make sure that the loop will be woken up.
Currently, _schedule_callbacks() calls loop.call_soon(), which already calls loop._check_thread(). So it looks like we don't need to change anything after all, right? |
|
Date |
User |
Action |
Args |
2017-11-07 15:42:09 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, pitrou, giampaolo.rodola |
2017-11-07 15:42:09 | yselivanov | set | messageid: <1510069329.21.0.213398074469.issue31960@psf.upfronthosting.co.za> |
2017-11-07 15:42:09 | yselivanov | link | issue31960 messages |
2017-11-07 15:42:09 | yselivanov | create | |
|