By bloid
via blogs.sun.com
Published: Apr 28 2008 / 16:38
Knowing atomic operation is very important when we are writing thread operation in Java. Covering atomic operation inside synchronized keyword is just a overhead which we discussed sometime back in one post. Now what all comes under atomic operation
Comments
gk75330 replied ago:
This wasn't insightful.
bloviatexjs replied ago:
It is a good topic but ends with a question and confusion. So, it has some good points.
htowninsomniac replied ago:
Java doesn't have a notion of an "atomic operation", except for the classes in the java.util.concurrent.atomic package, and even if an operation were atomic or a block could be made atomic, that would not help a lot, since the contents of a variable might be stale ("out of sync with the rest of the program") unless that variable is always protected by the same lock across all threads or volatile is used. Cf. JSR-133, "Java Memory Model".
Voters For This Link (8)
Voters Against This Link (4)