Andrew Svetlov <andrew.svet...@gmail.com> added the comment: Heh, should we sacrifice performance? Documentation for asyncio explicitly states that the only safe interthreading call is `call_soon_threadsafe()`.
If people use multithreaded environments with asyncio (Why? Usually `run_in_executor()` doesn't require communication with loop. Maybe they trying to do strange things like fetching web pages using aiohttp from Django application?) -- they should be aware of problems and consequences. Like threaded programming is potentially dangerous without locks and other things. I very doubt that correct asyncio program have problems like this. In opposite `call_soon()` is maybe the hottest path of asyncio, it should be as fast as possible. Any slowdown is not desirable. P.S. I believe teaching people to get rid of `run_until_complete()` but switching to `asyncio.run()` can help better than anything else. P.P.S. If a user wants to shoot in own leg -- nobody can stop it. Don't underestimate people's inventiveness. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33605> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com