Andrew Svetlov <andrew.svet...@gmail.com> added the comment:

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?

----------

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

Reply via email to