(Note on cross-meaning: this question was also posted on JRuby ( jruby@ruby-lang.org ) on December 20 and on the JRuby Forum on January 2, but has no answer yet).
This question is about understanding the impact of the LocalContextScope parameter in the presence of multithreading.
We can find a recipe in the JRuby Wiki that helps you choose the best value for the LocalContextScope parameter. This page explains that this control option, whether it be ScriptingContainer and / or Ruby Runtime and / or the Map variable, is shared between threads. However, I would like to get a somewhat deeper understanding of this issue, in particular, which part of the "system" is implemented, in which one of these three components.
As a concrete example: when I create global variables in Ruby or new classes or functions and variables in a top-level context, do they belong to the ScriptingContainer, at run time, or to a variable map? If without knowing this, I do not know which LocalContextScope I should use.
jruby
user1934428
source share