Showing posts with label volatile. Show all posts
Showing posts with label volatile. Show all posts

Friday, 15 January 2010

Volatile vs Atomic

Volatile can gaurantee execution order and solve double checked logging problem.

You can not use Volatile as a counter shared by multiple threads. For that you must use Atomic

see:

http://jeremymanson.blogspot.com/2007/08/volatile-does-not-mean-atomic.html