0
Life Cycle Iteration
In the figure which displays the life cycle of threads, you have waiting which inevitably results in death.... that's pretty dark. So, really? Waiting does not come after "runnable", but after "running"? In my mind runnable > waiting > running > death would make more sense. What's waiting good for? Example please!
1 Resposta
+ 1
runnable > running > blocked(waiting) > running > dead
however , a thread can go to dead state directly from either blocked or running.
the main reason for killing a blocked thread is starvation (indefinite waiting and hence indefinite locks on particular resources) ,which leads to blocking of other threads.