Can someone please explain me the difference between Sleeping
, Wait
, Park
, and Monitor
thread states in VisualVM.
This is what I have found:
Running
: thread is still running.
Sleeping
: thread is sleeping (method yield() was called on the thread object)
Wait
: thread was blocked by a mutex or a barrier, and is waiting for another thread to release the lock
Park
: parked threads are suspended until they are given a permit. Unparking a thread is usually done by calling method unpark() on the thread object
Monitor
: threads are waiting on a condition to become true to resume execution
What I am unable to understand is the state Park, what actually suspends the thread? How do I detect in the code what has made the thread suspend its execution?
Can someone please guide me in this regard.
Thanks.