• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SingleTon class

 
h kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All,

Can any one give answer for this question...

how can you make singleton class as threadsafe ?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15482
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you post a question, please take a moment to think in which forum you can post it best: carefully choose one forum.

This question does not have anything to do with Tomcat - I will move it to a more appropriate forum.
 
bart zagers
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is actually a Javaranch FAQ question (also read the linked newsletter entry).
 
Krithika Srinath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take a look at this faq.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Krithika Srinath:
take a look at this faq.


Sigh.

No, don't take a look at that FAQ. It shows the (discredited) "double-checked locking" technique. It's wrong and not thread-safe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic