7

(Crossposting note: This question has also been posted at the JRuby mailing list (jruby@ruby-lang.org) on December 20 and on JRuby Forum on January 2nd, but hasn't got any response yet).

This question is about understanding the impact of the LocalContextScope parameter in the presence of multi-threading.

We can find at the JRuby Wiki a recipe which helps about choosing the best value for the LocalContextScope parameter. This page explains, that this parameter controls, whether ScriptingContainer and/or Ruby Runtime and/or Variable Map is shared among threads. However, I would like to get a somewhat deeper understanding to this issue, in particular, which part of the "system" is implemented in which one of those three components.

As a concrete example: When I create global variables in Ruby, or new classes, or functions and variables in the top level context, do they belong to the ScriptingContainer, to the runtime, or to the variable map? Unless knowing this, I don't know which LocalContextScope I have to use.

user1934428
  • 19,864
  • 7
  • 42
  • 87

0 Answers0