S
Sumukh
Hi ,
I have one volatile variable declared as
private volatile long _volatileKey=0;
This variable is being incremented(++_volatileKey) by a method which is
not synchronized. Could there be a problem if more than one thread tries
to change the variable ?
In short is ++ operation atomic in case of volatile variables ?
Thanks
Sumukh
I have one volatile variable declared as
private volatile long _volatileKey=0;
This variable is being incremented(++_volatileKey) by a method which is
not synchronized. Could there be a problem if more than one thread tries
to change the variable ?
In short is ++ operation atomic in case of volatile variables ?
Thanks
Sumukh