If 10 threads having equal periority and waiting for one particular object (source ), How the source will notify to the particular thread.

This question is related to Oracle Interview

Showing Answers 1 - 3 of 3 Answers

shyamsundar

  • Jan 4th, 2007
 

There is no way of notifying a particular thread among threads of equal priority. In fact there is no way of notifying a particular thread. We can either notify the object using notify() method in which case any one of the threads will be notified or we can notify all the threads using notifyAll() method waiting on a particualar object in which case any one of the threads will be chosen by thread scheduler to run on availablity of lock but there is no guarantee that a particular thread will run.

gopalakrishnan

  • Oct 5th, 2007
 

If 10 threads are waiting for same priority to access a same resource, at that time the control have a FIFO order by the threads to access a resource.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions