Atomicity

  • Thread starter Thread starter C# Learner
  • Start date Start date
C

C# Learner

Is a float [C#] which is declared as volatile [C#] guaranteed to be read
from and written to atomically?
 
C# Learner said:
Is a float [C#] which is declared as volatile [C#] guaranteed to be read
from and written to atomically?

It's guaranteed to be read from and written to atomically whether or
not it's declared volatile.
 
Hmm..then the only purpose is to set up automatic memory barriers when you
have a volatile variable?

And just curious - what's the VB.NET equivalent of 'volatile'?
 
Sriram Krishnan said:
Hmm..then the only purpose is to set up automatic memory barriers when you
have a volatile variable?
Yes.

And just curious - what's the VB.NET equivalent of 'volatile'?

I don't think there is one.
 
Back
Top