-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Description
Feature or enhancement
Proposal:
Currently Interpreter.prepare_main()
(from concurrent.interpreters) fails if the interpreter is running. (See Interpreter.is_running()
. It may make sense to relax this restriction.
For example, it might make sense for a subinterpreter to call prepare_main()
on the main interpreter to share a cross-interpreter Queue
. Currently that fails because the main interpreter is always considered to be "running".
The answer for now is "make sure the main interpreter creates any queues it needs to share" and that might be good enough.
It's something I hadn't considered before and I'm not exactly sure yet that allowing it would be the right thing. The problem is that it isn't intuitively obvious to users (or me) how externally modifying an interpreter's __main__
module may affect code running there in a different thread.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
Projects
Status