A typical JVM implementation of dynamically scoped variables tends to use ThreadLocal
variables.
In code that uses Future
s pervasively, a thread can be used my multiple Future
s. In such a setting, is it safe to use ThreadLocal
based implementations?
If not, how do I emulate a dynamically scoped variable that can work with Future
s? (i.e. a sort of FutureLocal
variable)