This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: static modules and local vars
62945 wrote:
I imagine this implies that closures coming from a
static module are safe as well
Yes and no. Closures and objects are conceptually
equivalent. (They're implemented similarly, and you can
use one to simulate the other.) If you create a closure
in one thread, and pass that closure to another thread,
you might get thread safety problems - though only
if either thread modifies the captured variable (field)
while sharing it.
But this is no different than if you create a list in
one thread, and pass it to another thread.
> (since they be stack things when in use)
Note sure what you mean, but I think you're wrong.
--
--Per Bothner
per@bothner.com http://per.bothner.com/