Episode 11. New Year's Resolution: Object Thread Safety! + Listener feedback, and the birth of a Google Group!

17 views
Skip to first unread message

Freddy Guime

unread,
Dec 16, 2011, 1:21:30 AM12/16/11
to Javapubhouse
In this podcast we air our first question/feedback from our listener
and dive a little into it (related to Dependency Injection). We also
talk about how to create Thread Safe objects (There is the easy way,
and the hard way). And at last! we have a Google group where you can
add/post comments and open discussions.

praveen....@gmail.com

unread,
Aug 18, 2017, 10:55:18 AM8/18/17
to Java Pub House
Hey Freddy firstly great podcast on thread safety about thread safety. I had a question about safe publication in case of synchronization.
Synchronization does not guarantee safe publication right ?
If we need safe publication we need to pass in a volatile field right?

A good example will be a singleton with Double Lock Synchronization with lazy initialization . This guarantee's that only one thread can only create a singleton instance but it does not guarantee that this will be written in memory and be visible to other threads.

In that case we can effectively have 2 instance of singleton unless we use volatile correct?
Reply all
Reply to author
Forward
0 new messages