July 20, 2004 volatile - and - CASE | ||||
---|---|---|---|---|
| ||||
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.) |
July 20, 2004 Re: volatile - and - CASE | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tom Popovich | "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 since its > easy to implement and useful [never cache the variable]. Volatile has different semantics in C, C# and Java. The most useful meaning 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! |
Copyright © 1999-2021 by the D Language Foundation