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, hniksic, yselivanov
Date 2018-05-23.20:08:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527106116.57.0.682650639539.issue33605@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-05-23 20:08:36asvetlovsetrecipients: + asvetlov, hniksic, yselivanov
2018-05-23 20:08:36asvetlovsetmessageid: <1527106116.57.0.682650639539.issue33605@psf.upfronthosting.co.za>
2018-05-23 20:08:36asvetlovlinkissue33605 messages
2018-05-23 20:08:36asvetlovcreate