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@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@puremagic.com
http://lists.puremagic.com/mailman/listinfo/dmd-internals