DIP62: Volatile type qualifier for unoptimizable variables in embedded programming
ponce via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 16 03:01:05 PDT 2014
On Tuesday, 15 July 2014 at 21:28:24 UTC, Walter Bright wrote:
> Peek/poke has a 40 year history of being used for MMIO, and
> I've never heard of it being used for concurrency. I don't
> think there's endemic confusion, quite unlike volatile.
There is a huge confusion about volatile in the native space. No
one really knows what it does and when it should be used, because
it's kind of rare.
I've seen pervasive volatile use make some GPU kernels 100x
slower. Programming by coincidence, sure, but _explicit_
barriers, being read/write/optimizer barriers, I find them much
better. volatile is more like denial, and importing the history
behind the keyword would negative PR. Pascal had no volatile, and
using &= from a memory-mapped location doesn't exactly scream
"performance".
More information about the Digitalmars-d
mailing list