✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Let's say that we are writing a concurrent Java program.
A group of threads are waiting for a certain condition to become true, and each calls wait so that they can be informed about changes that will occur at some future point. The wait calls occur in the following order:
thread1 calls wait
thread2 calls wait
thread3 calls wait
thread4 now changes some shared variable, and needs to inform the others about the change. So thread4 invokes the following
notify
Which of the threads will be notified, given the order in which they called wait?