Optional monitors suggestion

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon May 19 06:35:46 PDT 2014


On Sun, 18 May 2014 06:33:55 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 5/17/14, 10:01 PM, Walter Bright wrote:
>> On 5/14/2014 2:17 PM, Andrei Alexandrescu wrote:
>>> On 5/14/14, 6:33 AM, Yuriy wrote:
>>>> 4. I consider D a killemall language, that may be potentially used on
>>>> tiny AVRs and PICs, where polymorphism might be welcome, but an extra
>>>> pointer for each class instance may become a blocker. I know, thats
>>>> fantasy now, but i think it's crucial to keep this concept of D.
>>>
>>> Agreed at least with the "killing the mall" part :o).
>>
>> While I agree with Andrei's agreements (!), the rationale for the
>> current approach is to make it relatively straightforward to translate
>> existing Java code into D. There was a fair amount of this in the early
>> days of D, I'm not sure how much of that lately.
>
> Maybe I misunderstood - I thought the change preserves semantics. --

You didn't misunderstand. The change will use an external monitor stored  
in a global hashtable if an internal monitor does not exist.  
synchronized(obj) will always work, even if the object does not contain a  
monitor field.

-Steve


More information about the Digitalmars-d mailing list