This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients giampaolo.rodola, gvanrossum, pitrou, yselivanov
Date 2017-11-07.15:42:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510069329.21.0.213398074469.issue31960@psf.upfronthosting.co.za>
In-reply-to
Content
>> 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?
History
Date User Action Args
2017-11-07 15:42:09yselivanovsetrecipients: + yselivanov, gvanrossum, pitrou, giampaolo.rodola
2017-11-07 15:42:09yselivanovsetmessageid: <1510069329.21.0.213398074469.issue31960@psf.upfronthosting.co.za>
2017-11-07 15:42:09yselivanovlinkissue31960 messages
2017-11-07 15:42:09yselivanovcreate