[dmd-internals] Regarding deprecation of volatile statements

deadal nix deadalnix at gmail.com
Tue Jul 24 15:19:23 PDT 2012


C's volatile garantee that the compiler will not promote the variable to a
register and doo all memory read write in order.

This is mandatory if you want to interface with some memory mapped device
for instance.

This has nothing to do with concurency.

2012/7/25 Walter Bright <walter at digitalmars.com>

>
> On 7/24/2012 2:53 PM, Alex Rønne Petersen wrote:
>
>> But shared can't replace volatile in kernel space. shared means
>> atomics/memory fences which is not what I want - that would just give me
>> unnecessary overhead. I want the proper, standard C semantics of volatile,
>>
>
> C does not have Standard semantics for volatile. It's a giant mess.
>
>
>  not the atomicity that people seem to associate with it.
>>
>
> Exactly what semantics are you looking for?
>
>
>  Besides, shared isn't even implemented yet - how can it actually be
>> called a valid replacement for volatile at all, at this point?
>>
>
> D volatile isn't implemented, either.
>
>
>  It seems amazing to me that volatile was deprecated in favor of something
>> that isn't actually implemented (and even more amazing that the error
>> message points to a feature that doesn't do the same thing)... Note that
>> I'm writing actual kernel code here. I need something that actually works
>> or I can't reliably write this code in D...
>>
>
> I need to know what you're looking for.
>
>
> ______________________________**_________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/**mailman/listinfo/dmd-internals<http://lists.puremagic.com/mailman/listinfo/dmd-internals>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20120725/56de6b63/attachment.html>


More information about the dmd-internals mailing list