I use a shared flag between threads. I am really worry about the performance of updating/getting a boolean flag, whether it is volatile or Atomic?
Tell me which one is best volatile or Atomic?
-----------------------
suresh
I use a shared flag between threads. I am really worry about the performance of updating/getting a boolean flag, whether it is volatile or Atomic?
Tell me which one is best volatile or Atomic?
-----------------------
suresh
Usually for synchronization atomic access is used. And variable declared as volatile, will have atomic access by default.
If you just need the values between threads, you might want consider using a static variable.
In any case, Official JAVA page for your atomic doubts.
http://java.sun.com/docs/books/tutor...cy/atomic.html
Cheers!
Kalayama
Last edited by kalayama; 05-11-2007 at 08:14 AM. Reason: typo
[COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
Thanks Kalayama...
--------------------
suresh
Hey Suresh! If you need to say Just "Thanks" press the button next to my post There is no poing in just posting "Thank You" anyway...
Cheers!
Kalayama
[COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"