Nice to @Share?
Peter Levart
peter.levart at marand.si
Tue Feb 23 03:06:02 PST 2010
On Tuesday 23 February 2010 09:08:22 Zdenek Tronicek wrote:
> In some sense, Mark is right. Of course, you can share strongly immutable
> objects without any synchronization. But how to share the reference? If
> one thread stores a reference to a shared variable, how do you ensure that
> such change is visible in another thread? You need a barrier and this is
> probably where the hint "make the shared variables final" comes from.
>
> Z.
> --
> Zdenek Tronicek
> FIT CTU in Prague
>
The barrier is usually made when you dispatch the reference to function to some other thread, so you don't have to worry about it...
Peter
More information about the lambda-dev
mailing list