how to handle a singleton service locator. when multiple threads
are trying to get the singleton object in same time

Answers were Sorted based on User's Feedback



how to handle a singleton service locator. when multiple threads are trying to get the singleton ob..

Answer / sitaram

Singleton service means only one service provide at a
time.When multiple threads are trying to get the singleton
object in the same time.we can get an error. because only
one object provide in complete application.

Is This Answer Correct ?    17 Yes 3 No

how to handle a singleton service locator. when multiple threads are trying to get the singleton ob..

Answer / krishnapal

Using synchronized method we can using put requesting
threads into waiting queue.

Is This Answer Correct ?    3 Yes 0 No

how to handle a singleton service locator. when multiple threads are trying to get the singleton ob..

Answer / wikipedia

Detailed answer here:
http://en.wikipedia.org/wiki/Singleton_pattern

Is This Answer Correct ?    0 Yes 1 No

how to handle a singleton service locator. when multiple threads are trying to get the singleton ob..

Answer / gowramma m

Two ways to create threads
1)by creating thread class
class classname extends Thread
{


}
2)By converting class to thread ie using Runnable interface

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More Core Java Interview Questions

Can a constructor call the constructor of parent class?

0 Answers  


what is check p object in java

1 Answers   TCS,


Which class has no duplicate elements?

8 Answers  


What is multi level inheritance in java?

0 Answers  


What is the difference between call by reference and call by pointer?

0 Answers  


What is the use of default method in interface in java?

0 Answers  


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

0 Answers  


What is starvation?

0 Answers  


How to obtain a performance profile of java program

0 Answers  


Is java written in c?

0 Answers  


What restrictions are placed on method overriding in java programming?

0 Answers  


How does java pattern compile work?

0 Answers  


Categories