title: Rhino and concurrent access to javax.script.ScriptEngine
body: <p>I'm using Rhino 1.6r2 through the <code>javax.script</code> API. I know that the Rhino engine claims to be <a href="http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngineFactory.html#getParameter%28java.lang.String%29" rel="nofollow noreferrer">MULTITHREADED:</a> "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." </p>
  
  <p>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 <code>ScriptEngine</code> object, but for every execution I create a new <code>SimpleBindings</code> and pass it to <code>eval(String, Bindings)</code>. With this arrangement, is there any way that internal state could leak from one execution to another? If so, how?</p>
  
  <p><a href="https://stackoverflow.com/a/8585554/365719">There's a very informative answer here</a>, but it doesn't <em>quite</em> tell me what I need to know.</p>