What is the lifecycle and concurrency semantics of Rhino Script Engine

Viewed 4259

I am interested in the lifecycle and concurrency semantics of (Rhino) Script Engine and associated classes. Specifically:

  1. Is Bindings supposed to be thread safe?
  2. Should multiple threads be allowed to share a single ScriptEngine instance?
  3. ... or should each thread construct a short-lived instance?
  4. ... or keep them in a pool?
  5. What happens if multiple threads concurrently call ScriptEngine.eval(...)?
  6. Same questions for CompiledScript instances
  7. Same questions for interface implementations generated using Invocable.getInterface(...)?
  8. Presumably, objects placed in Bindings follow Java's garbage collection. What about garbage collection of objects that don't end up in the bindings?
1 Answers
Related