Yury Selivanov <yseliva...@gmail.com> added the comment:

>> 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?

----------
stage: patch review -> 

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

Reply via email to