Gateway Timer Events vs. Threading?

The two interpreters are running in the same JVM, so not like designer vs. gateway scopes at all.

And jython is fully multi-threaded. Persistent dictionaries like system.util.getGlobals() and my alternatives are java objects, sharable across interpreters.

If you never start your own asynchronous threads, and never put things in persistent dictionaries, and never add listeners to gateway scope infrastructure, and never use infinite loops, interpreter cleanup is assured.

But that is quite the set of handcuffs.

(The nitty gritty details of python won't help--jython is a separate implementation.)

I should mention that when java infrastructure calls a jython code object that is implementing a java interface, the calling thread will adopt that code's declaring intepreter and drive on. If a new interpreter calls an old code object through persistence, then old code will run in the new interpreter and things get weird.

1 Like