DMD 1.029 and 2.013 releases

Sean Kelly sean at invisibleduck.org
Sat Apr 26 12:52:20 PDT 2008


Walter Bright wrote:
> Sean Kelly wrote:
>> Walter Bright wrote:
>>> Sean Kelly wrote:
>>>> Walter Bright wrote:
>>>>> Sean Kelly wrote:
>>>>>> I suppose the obvious question here is: what if I want to create a 
>>>>>> mutex
>>>>>> in D?
>>>>>
>>>>> Why do you need volatile for that?
>>>>
>>>> To restrict compiler optimizations performed on the code.
>>>
>>> The optimizer won't move global or pointer references across a 
>>> function call boundary.
>>
>> Even if the function is inlined?
> 
> No, but a mutex involves an OS call. Inlining is also easily prevented.

An OS call isn't always involved.  See, for example: 
http://en.wikipedia.org/wiki/Futex.


Sean


More information about the Digitalmars-d-announce mailing list