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

Andrew Wiley wiley.andrew.j at gmail.com
Sun Jun 3 15:00:05 PDT 2012


*>From:* mta`chrono <chrono at mta-international.net>
>*Sent:* Sunday, June 3, 2012 14:38:31
>*To:* digitalmars-d at puremagic.com
>*Subject:* Re: synchronized (this[.classinfo]) in druntime and phobos
>
>
>Am 30.05.2012 11:11, schrieb deadalnix:
>>
>> D already have much better tools that the one java provide
>> (std.concurency, std.parallelism, TLS by default, transitive type
>> qualifiers, . . .) that most these thing taken from java don't make any
>> sense now.
>>
>> For instance, what is the point of being able to lock on any object when
>> most of them are thread local ??
>
> Right! Locking on non-TLS objects doesn't make sense. Perhaps only
> shared objects should be synchronizeable and thus contain a monitor /
> pointer to a monitor.
auto thingy = new Thing();
auto sthingy = cast(shared)thingy;

As long as we support casting to/from shared, you can’t eliminate the
monitor pointer in any object.


Sent from my *Windows 8 PC* <http://windows.microsoft.com/consumer-preview>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120603/68282ab9/attachment.html>


More information about the Digitalmars-d mailing list