Message317340
> I suggest that asyncio should be stricter about this error and that methods and functions that operate on the event loop, such as call_soon, call_later, create_task, ensure_future, and close, should all call _check_thread() even when not in debug mode. _check_thread() warns that it "should only be called when self._debug == True", hinting at "performance reasons", but that doesn't seem justified. threading.get_ident() is efficiently implemented in C, and comparing that integer to another cached integer is about as efficient an operation as it gets.
I'd be OK with this if the performance penalty is within 0.5% in microbenchmarks for asyncio & uvloop. |
|
Date |
User |
Action |
Args |
2018-05-22 20:19:53 | yselivanov | set | recipients:
+ yselivanov, hniksic, asvetlov |
2018-05-22 20:19:53 | yselivanov | set | messageid: <1527020393.74.0.682650639539.issue33605@psf.upfronthosting.co.za> |
2018-05-22 20:19:53 | yselivanov | link | issue33605 messages |
2018-05-22 20:19:53 | yselivanov | create | |
|