Tag: producer-consumer thread problems

In a Producer & Consumer thread problem, producer thread has acquired the lock and multiple consumer threads are in wait pool, which consumer thread gets notified first, once producer thread calls notify?

Answer: The thread that it notifies depends on JVM implementation. We can’t really say which thread actually gets notified. It could be the first thread, it could be the last thread which went into the wait pool or it could be the highest priority thread. Most often the JVM implementation is as first thread goes…

Read the full article