Understanding Processor: Thread State
Posted: January 29th, 2009 | Author: TnT Admin | Filed under: Concepts | Tags: processor, Windows | No Comments »As we know, a multiprogramming OS switches the processor back and forth between all the program threads that are executing. When the current thread blocks, usually due to I/O, the Windows Scheduler finds another thread that is ready to run and schedules it for execution. If no threads are ready to run, Windows schedules a thread associated with the System Idle process to run instead. When an I/O operation completes, a blocked thread becomes eligible to run again. This scheme means that threads alternate back and forth between the two states: a ready state, where a thread is eligible to execute instructions, and a blocked state. A blocked thread is waiting for some system event that signals that the transition from waiting to ready can occur.
Thread state Counter is an instantaneous counter that you will need to observe at very fine granularity to catch this behavior. The following tables described the thread states and reasons.
Values for Thread State Counter
0 – Initializing
1 – Ready
2 – Running
3 – Standby
4 – Terminated
5 – Waiting
6 – Transition
7 – Unknown
Values for the Thread Wait Reason counter
1 – Waiting for a page to be freed
0 – Waiting for a component of the Windows NT Executive
1 – Waiting for a page to be freed
2 – Waiting for a page to be mapped or copied
3 – Waiting for space to be allocated in the page or nonpaged pool
4 – Waiting for an Execution Delay to be resolved
5 – Suspended
6 – Waiting for a user request
7 – Waiting for a component of the Windows NT Executive
8- Waiting for a page to be freed
9 – Waiting for a page to be mapped or copied
10 – Waiting for space to be allocated in the page or nonpaged pool
11 -Waiting for Execution Delay to be resolved
12 – Suspended
13 – Waiting for a user request
14 – Waiting for an event pair high
15 – Waiting for an event pair low
16 -Waiting for an LPC Receive notice
17 – Waiting for an LPC Reply notice
18 – Waiting for virtual memory to be allocated
19 – Waiting for a page to be written to disk
20+ – Reserved
(Source: Windows 2000 Performance Guide by Mark Friedman & Odysseas Pentakalos)
Leave a Reply