[dmd-concurrency] synchronized, shared, and regular methods inside the same class
Graham St Jack
graham.stjack at internode.on.net
Wed Jan 6 13:26:46 PST 2010
> So how about a quick summary to figure out where we are? From memory, I think it's pretty well established that:
>
> 1. shared denotes visibility. A global shared variable is visible from all threads, an unlabeled variable is thread-local.
> 2. Attaching the shared property to a class instance affects method visibility. shared and synchronized methods are visible, unlabeled ones are not.
> 3. Attaching the shared property to a value makes that value effectively atomic. All access and mutation is accomplished via library calls.
>
> I think there was some concern about the shared property of a class instance automatically extending to all of its fields. Were there other concerns as well? I know that Jason had mentioned issues with non-statically verifiable shared semantics in general, but that's another ball of wax entirely.
> _______________________________________________
>
I am assuming that item 2 includes the idea of unlabelled methods being
callable from methods of the shared instance.
More information about the dmd-concurrency
mailing list