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

What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?

0 Answers   Bravura Solutions,


What are serialization and deserialization?

0 Answers  


worst case complexities of Quick sort and Merge sort.

0 Answers   Amazon,


What is the difference between numeric and integer?

0 Answers  


what is difference between class and object?

43 Answers   College School Exams Tests, HCL,






How can we make a class singleton?

0 Answers  


How does java enable high performance?

0 Answers  


Can an object?s finalize() method be invoked while it is reachable?

2 Answers  


What initialize variables?

0 Answers  


Explain heap sort?

0 Answers   Flextronics,


What is literal example?

0 Answers  


Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this

1 Answers  


Categories