I'm using Rhino 1.6r2 through the javax.script
API. I know that the Rhino engine claims to be MULTITHREADED: "The engine implementation is internally thread-safe and scripts may execute concurrently although effects of script execution on one thread may be visible to scripts on other threads."
What I'd like to know is, under what exact conditions would the effects of one script execution be visible to another? In my code, I sometimes re-use a ScriptEngine
object, but for every execution I create a new SimpleBindings
and pass it to eval(String, Bindings)
. With this arrangement, is there any way that internal state could leak from one execution to another? If so, how?
There's a very informative answer here, but it doesn't quite tell me what I need to know.