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 asvetlov
Recipients asvetlov, dantimofte, ned.deily, ronaldoussoren, yselivanov
Date 2019-04-16.10:30:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555410627.43.0.910942096724.issue36626@roundup.psfhosted.org>
In-reply-to
Content
Not sure about `create_task()`.
Usually you create tasks from async code, where the `_write_to_self()` call is not needed.

Handling writing to self-pipe is not free, starting very many tasks at once can hit performance.

Stopping the loop is another beast, we can perform relative slow operations in such calls.

Thinking more about the issue I'm inclining to reject my initial proposal.

If you want to stop a loop from signal handler you should make `loop.call_soon_threadsafe(loop.stop)` call because `loop.stop()` is not thread-safe operation by definition.

Threadsafe call solves your problem, isn't it?
History
Date User Action Args
2019-04-16 10:30:27asvetlovsetrecipients: + asvetlov, ronaldoussoren, ned.deily, yselivanov, dantimofte
2019-04-16 10:30:27asvetlovsetmessageid: <1555410627.43.0.910942096724.issue36626@roundup.psfhosted.org>
2019-04-16 10:30:27asvetlovlinkissue36626 messages
2019-04-16 10:30:27asvetlovcreate