-
-
Notifications
You must be signed in to change notification settings - Fork 368
Description
hi! from_thread.run(_sync)?
uses a heuristic to prevent the user from accidentally deadlocking their event loop by writing code like https://github.com/python-trio/trio/pull/1574/files#r435039316.
the heuristic is currently much more aggressive than is required to prevent this deadlock, however. it has the side-effect1 of preventing one from calling from_thread.run(_sync)?
in any thread running trio, even though such calls are almost always safe and deadlock-free.
it would be useful to be able to call from_thread.run(_sync)?
from trio threads2, but the current heuristic blindly prevents this. i'd like to propose relaxing from_thread.run(_sync)?
to allow calling from_thread.run(_sync)?
from trio threads. (one use-case of this is agronholm/anyio#525.)