Enum ThreadWaitReason
Reason a thread left the CPU at a context-switch point. Hand-rolled mirror of Windows' KWAIT_REASON kernel enum (a.k.a. KTHREAD::WaitReason),
captured by the ETW scheduling pump from CSwitchTraceData.OldThreadWaitReason and carried on ThreadContextSwitch records.
public enum ThreadWaitReason : byte
Fields
DelayExecution = 4Delay-execution wait (e.g.
KeDelayExecutionThread).Executive = 0Waiting on a generic kernel object (event, mutex, semaphore, I/O completion). Most common "I'm blocked" reason.
FreePage = 1Backing pages need to be brought in before the thread can run.
MaximumWaitReason = 37Sentinel for values outside the kernel range observed at runtime — surfaces "unknown reason" in the viewer.
PageIn = 2Page-in for code/data is in flight.
PoolAllocation = 3System allocation / mapping operation in progress.
Suspended = 5Suspended via
SuspendThread/ debugger break-in.UserRequest = 6Explicit user-mode wait (
Sleep,WaitForSingleObject, etc.).WrCalloutStack = 25Calling out — heap manager / debugger callout in progress.
WrCpuRateControl = 24CPU rate-control throttle.
WrDelayExecution = 11Wr-prefixed mirror of DelayExecution.
WrDispatchInt = 31Dispatch interrupt — switched via DPC/dispatch.
WrExecutive = 7Wr-prefixed mirror of Executive — currently blocked on a kernel object.
WrFastMutex = 34Fast-mutex (FMUTEX) blocking.
WrFreePage = 8Wr-prefixed mirror of FreePage.
WrGuardedMutex = 35Guarded mutex blocking — guarded regions disable APC delivery while held.
WrKernel = 26Kernel mutex blocking.
WrKeyedEvent = 21Push-lock acquire (lightweight reader/writer lock).
WrLpcReceive = 16LPC (Local Procedure Call) receive — waiting for a request.
WrLpcReply = 17LPC reply wait — waiting for the responder.
WrMutex = 29Kernel mutex blocking (KMUTEX).
WrPageIn = 9Wr-prefixed mirror of PageIn — paging stall.
WrPageOut = 19Page-write completion.
WrPoolAllocation = 10Wr-prefixed mirror of PoolAllocation.
WrPreempted = 32Preempted by a higher-priority thread.
WrProcessInSwap = 23Processor-affinity / hot-removal pause.
WrPushLock = 28Push-lock (ERESOURCE-style fast lock) blocking.
WrQuantumEnd = 30Quantum end — the thread used up its scheduling quantum. Pure CPU pressure indicator.
WrQueue = 15Queue wait — typically a threadpool worker waiting for work, or an IO completion port.
WrRendezvous = 20Lazy-mapping operation in progress.
WrResource = 27Resource manager I/O wait.
WrRundown = 36Object-rundown protection wait.
WrSpare0 = 14Spare slot from the kernel definition; retained for wire stability.
WrSuspended = 12Wr-prefixed mirror of Suspended.
WrTerminated = 22Terminated — thread is exiting.
WrUserRequest = 13Wr-prefixed mirror of UserRequest — explicit user-mode wait.
WrVirtualMemory = 18Waiting for virtual-memory commit / fault resolution.
WrYieldExecution = 33Voluntary
SwitchToThread/Yield.
Remarks
Wire stability: numeric values are part of the .typhon-trace file format — never renumber. Mirror of the kernel enum as of Windows 11 24H2;
newer Windows builds may append entries (e.g. WrPhysicalFault) that we do not currently mirror. Out-of-range values land on
MaximumWaitReason at decode time so the viewer can still display the slice with an "unknown reason" label.
Naming: Microsoft uses two conventions in the same enum. Unprefixed names (e.g. Executive, UserRequest) describe the kernel object
family the thread is transitioning into a wait on. Wr-prefixed variants (e.g. WrExecutive, WrUserRequest) describe the kernel object
family the thread is currently blocked on while in the Wait state. In practice the pairs are observed together as (threadState, waitReason)
tuples; the viewer collapses them into a single label.
Most informative values for the viewer:
- WrQuantumEnd — thread used its quantum; pure CPU pressure with peers competing.
- WrPreempted — higher-priority thread took the core.
- Executive / WrExecutive — blocked on a kernel object (event, mutex, sem, I/O).
- UserRequest / WrUserRequest — explicit user-mode wait (Sleep, WaitForSingleObject, etc.).
- WrPushLock, WrMutex, WrFastMutex, WrGuardedMutex, WrKeyedEvent — sync-primitive blocking.
- WrQueue — threadpool / IO-completion queue wait.
- WrVirtualMemory / PageIn / WrPageIn — paging stall.
- WrYieldExecution — voluntary
SwitchToThread/Yield.