I’m using JRuby Embed API in my Java code, where I create an object
graph that is processed and then passed to Ruby code. This graph
contains e.g. RubyHash and RubyArray objects.
The Java code runs in a multi-threaded environment and I’d like to
make sure I’m not introducing any race conditions.
The application instantiates a single ScriptingContainer object, which
is shared among different threads.
sc = new ScriptingContainer(LocalContextScope.CONCURRENT);
RubyHash/Array objects are instantiated as follows:
RubyHash rh = new RubyHash(sc.getProvider().getRuntime());
Here the API requires that the Ruby runtime object is passed to
Is this code thread-safe?
Can RubyHash objects be instantiated in another way?