Message12934
Code archeology shows that the thread-local state is a response to #1426. This all stems from a desire to avoid re-creating the ScriptEngine, but instead serve multiple (concurrent?) purposes by the client code keeping a context for each. This suggests the context should hold all the interpreter state.
It's a complicated discussion.
A context is not a thread, but the solution seems to be that we swap local variables (or are they global?) according to the current *thread*. I don't see how that achieves the aim but seemed to satisfy those involved at the time.
It's not the time to re-work it. So I guess I should avoid changing this too much. In particular, restoring a __main__ module might be going too far.
I'll spend some time tracing this through. |
|
Date |
User |
Action |
Args |
2020-01-26 20:57:26 | jeff.allen | set | messageid: <1580072246.92.0.16238500057.issue2846@roundup.psfhosted.org> |
2020-01-26 20:57:26 | jeff.allen | set | recipients:
+ jeff.allen, zyasoft, alexgobbo |
2020-01-26 20:57:26 | jeff.allen | link | issue2846 messages |
2020-01-26 20:57:26 | jeff.allen | create | |
|