If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.
Answer given is false.
I believe it is true. Can any one confirm it please? Thank you in advance.
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
Joined: Nov 05, 2004
The key here is "definetly" I beleive that the answer depends on the JVM and the OS. So, when you are writing your platform-independent code, you cannot definetly say that the first thread going into the wait will be the first to resume execution