best answer > Is Singleton class thread safe 2024?- QuesHub | Better Than Quora
The most authoritative answer in 2024
  • Amelia Brown——Studied at the University of Sydney, Lives in Sydney, Australia.

    In the above code, getInstance() method is not thread safe. Multiple threads can access it at the same time and for the first few threads when the instance variable is not initialized, multiple threads can enters the if loop and create multiple instances and break our singleton implementation.read more >>
    +119962023-05-06 04:45:24

About “thread safe、threads、threads”,people ask:

READ MORE:

QuesHub is a place where questions meet answers, it is more authentic than Quora, but you still need to discern the answers provided by the respondents.

分享到

取消