Yury Selivanov <yseliva...@gmail.com> added the comment: > 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. ---------- _______________________________________ 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