synchronized (this[.classinfo]) in druntime and phobos

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 29 14:41:44 PDT 2012


On 5/29/12 5:29 AM, Dmitry Olshansky wrote:
> Agreed, awfuly crippled design for a language with Thread-local by default.
> Looks like we have 'oh my god, what were they thinking' moment here.

The synchronized class feature was copied by Walter from Java while he 
at the time had only little understanding of multithreading. The 
thread-local by default notion was added much later.

Indeed we'd design things very differently if synchronized came about 
later. The design of "synchronized" described in TDPL and not yet 
implemented is a conciliation of the two.

> If anything I'd rather re-implement the whole v-table infrastructure via
> mixins, templates & friends.

Could you please elaborate how that would help multithreading?


Andrei



More information about the Digitalmars-d mailing list