Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Arland Smith   on Jun 10 In Java Category.

  
Question Answered By: Vid Fischer   on Jun 10

It is not a bug, the standard double-checked locking  doesn't work due to massive changes to the compilers which is made for better performance and regardless of that, new servers are multiproccessor and they have changed their algorithm accessing the memory in terms of speed and performance.

The problem is visibility, which means, the time takes the changes made to a shared variable becomes visible to another thread is indefinite and making the variable volatile guarantees the visibility of modified data across the threads

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Double-checked locking Or get search suggestion and latest updates.


Tagged: