A number of threads of the same priority have relinquished the lock on a monitor and are in a waiting state after having called the wait() method of the object. A new thread enters the monitor and calls the notifyAll() method of the meonitor. Which of these threads will be the first one to resume?

  1. The thread that has been waiting the longest.

  2. The thread that was the last one to to exit the monitor.

  3. You can never be sure which thread will get to run first.

  4. The the first thread that called the wait() method


Correct Option: C

Find more quizzes: