Java / Java Multithreading
Difference between thread state WAIT and BLOCKED.
A thread gets to wait state once it calls wait() on an Object. This is called Waiting State. Once a thread attains waiting state, it will continue to wait till some other thread notify() or notifyAll() on the object.
Once this thread is notified, it will not be runnable. It might be that other threads are also notified (using notifyAll()) or the first thread has not finished his work, so it is still blocked till it gets its chance. This is called Blocked State.
Once other threads have left and this thread gets chance, it moves to Runnable state after that it is eligible pick up work based on JVM threading mechanism and moves to run state.
More Related questions...