volatile variables in D....

Sean Kelly sean at f4.ca
Thu Apr 12 19:15:54 PDT 2007


Sean Kelly wrote:
> 
> Yup.  But given that no such feature exists in D right now, I was 
> suggesting alternatives.

For what it's worth, I don't think the C++ implementation of 'volatile' 
is really ideal.  Qualifying something as 'volatile' has a viral effect 
on code, and overloading and such can become fairly complicated.  Also, 
the requirements for memory mapped io are a subset of the requirements 
for multithreaded programming, so by properly addressing multithreading 
I think memory mapped io will be supported "for free."  The C++ 0x 
discussions seem pretty promising here, so perhaps something similar 
will be done in D once the dust settles a bit in the C++ arena.

In short, I agree that something more than the 'volatile' statement we 
have in D now would be useful, and suspect we'll get something before 
too terribly long.  In the interim, I would probably implement a value 
"proxy" struct to simplify things.


Sean



More information about the Digitalmars-d mailing list