The state of a thread in .NET framework is explained in this link.
I recently saw this picture in a web-site and a couple of questions came to my mind:
The thread lifecycle in the OS is not completely aligned with thread lifecycle in .NET framework. Can someone provide a resource that matches the states in OS with .NET framework?
We don't have a state called Blocked in .NET framework. What will be the state of a thread if it issues an I/O request?
What is the purpose of the Aborted state? When a thread calls the Abort()
method, it will go to the AbortRequested state and after the thread responds to abort request, it will go to Stopped state. So what is the function of Aborted state?
A thread is blocked if its execution has been suspended by one of the synchronization primitives, such as a lock or a mutex. Any thread that is performing useful work at a given moment is, by definition, not blocked at that moment.
The AbortRequested/Stopped
cycle gives the thread an opportunity to perform an orderly shutdown, releasing acquired resources and performing other cleanup tasks.