Message12934

Author jeff.allen
Recipients alexgobbo, jeff.allen, zyasoft
Date 2020-01-26.20:57:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580072246.92.0.16238500057.issue2846@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-01-26 20:57:26jeff.allensetmessageid: <1580072246.92.0.16238500057.issue2846@roundup.psfhosted.org>
2020-01-26 20:57:26jeff.allensetrecipients: + jeff.allen, zyasoft, alexgobbo
2020-01-26 20:57:26jeff.allenlinkissue2846 messages
2020-01-26 20:57:26jeff.allencreate