DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 16 01:10:46 PDT 2014


On 16 July 2014 08:08, Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 7/15/2014 11:32 PM, Iain Buclaw via Digitalmars-d wrote:
>>
>> On 16 July 2014 07:12, Walter Bright via Digitalmars-d
>> <digitalmars-d at puremagic.com> wrote:
>>>
>>> On 7/15/2014 9:29 PM, Brad Roberts via Digitalmars-d wrote:
>>>>
>>>>
>>>> I don't have any skin in this particular discussion, but it's worth
>>>> pointing out
>>>> here that while it's cute that builtin's can be added, when they're not
>>>> part of
>>>> the language definition, they're not really part of a portable solution.
>>
>> > They're as portable as we want them to be.
>> I read that as, not portable at all then. :o)
>
>
>
> C'mon, guys. It's our spec and we can make it work.

And we are trying to make it work.

I actually have quite a bit to be planned out after removing the
'volatility' from shared.

>From the following spec:

'''
Unlike the shared attribute, __gshared provides no safe-guards against
data races or other multi-threaded synchronization issues. It is the
responsibility of the programmer to ensure that access to variables
marked __gshared is synchronized correctly.
'''

GDC will likely in future emit atomic loads, stores, and possibly
fences around the use of shared data.

As there is no specific meaning to what 'safe-guards' come with
shared.  I interpret that to keep in line with a happens-before style
relationship with sequential reads/writes to shared data.

Regards
Iain


More information about the Digitalmars-d mailing list