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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top