This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Volatile versus Synchronized in Java 5 and Later Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Volatile versus Synchronized in Java 5 and Later" Watch "Volatile versus Synchronized in Java 5 and Later" New topic
Author

Volatile versus Synchronized in Java 5 and Later

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
Please help me to understand this:

In Java 5 and later version, when we would use the volatile keyword and why is it different than using synchronized?

Thank you.
Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 117
This link will help you .


Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
Thanks very much for the link. Everything is well explained.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Volatile versus Synchronized in Java 5 and Later
 
Similar Threads
singleton synchronized doubt
volatile
threads
Question regarding Singleton pattern
synchronized class