digitalmars.D - volatile - and - CASE
- Tom Popovich (8/8) Jul 19 2004 volatile: I see that volatile is not supported. many times in system
- Walter (11/18) Jul 20 2004 its
volatile: I see that volatile is not supported. many times in system programming you need to tell the compiler that variable X might change mysteriously and therefore should not be cached in a register. You might want to support (maybe in a future release) this feature since its easy to implement and useful [never cache the variable]. -Tom. PS: I just started looking at D and it looks very nice and an excellent idea. (dont let the nit-picking throw you off.)
Jul 19 2004
"Tom Popovich" <Tom_member pathlink.com> wrote in message news:cdie80$1518$1 digitaldaemon.com...volatile: I see that volatile is not supported. many times in system programming you need to tell the compiler that variable X might change mysteriously and therefore should not be cached in a register. You might want to support (maybe in a future release) this feature sinceitseasy to implement and useful [never cache the variable].for it is to establish 'write barriers' and 'read barriers' to facilitate multi-threaded programming. The volatile statement in D accomplishes this. It's actually pretty rare to need volatile to put read cycles on hardware memory locations, in D that is best accomplished by doing one line if inline assembler, rather than rippling a volatile type modifier throughout the semantics of the language.PS: I just started looking at D and it looks very nice and an excellent idea. (dont let the nit-picking throw you off.)Thanks!
Jul 20 2004