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?