Using multiple interpreters vs reusing one

Bulat Yaminov <[email protected]> Tue, 18 Oct 2016 16:10:47 +0200
Newsgroups gmane.comp.lang.jython.user
Message-ID <CAH_7x1vPiMggxfgPUw2n1sDGV-MKN4P5yvxfX2gMkhoDHn8pow@mail.gmail.com>
Hi everybody!

I'm developing an application where Jython scripts would be executed once
in a while as part of executing a workflow of tasks. So the number of tasks
and the time when they execute can be random and depends on the users'
input. In any case it can happen in parallel.

The question is, should I better create a separate new engine for each
scripts, like in "new
ScriptEngineManager().getEngineByName(PYTHON_ENGINE)". Or should I instead
create the engine once globally for my application and then just call
"jythonEngine.eval(script, scriptContext)" whenever running a user's task?

Maybe creating a new engine for each execution would be much slower? Or
maybe reusing the engine could lead to some isolation problems?

Thanks in advance for your comments!

Regards,
Bulat Yaminov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users