大网数据广告活动
性能与资源

CSwitch class

· 52CE 我爱测

This class is the event type class for context switch events. The following syntax is simplified from MOF code.

This class is the event type class for context switch events.

The following syntax is simplified from MOF code.

Syntax

[EventType{36}, EventTypeName{"CSwitch"}]
class CSwitch : Thread_V2
{
  uint32 NewThreadId;
  uint32 OldThreadId;
  sint8  NewThreadPriority;
  sint8  OldThreadPriority;
  uint8  PreviousCState;
  sint8  SpareByte;
  sint8  OldThreadWaitReason;
  sint8  OldThreadWaitMode;
  sint8  OldThreadState;
  sint8  OldThreadWaitIdealProcessor;
  uint32 NewThreadWaitTime;
  uint32 Reserved;
};

Members

The CSwitch class has these types of members:

Properties

The CSwitch class has these properties.

NewThreadId

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(1), Format("x")

New thread ID after the switch.

NewThreadPriority

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(3)

Thread priority of the new thread.

NewThreadWaitTime

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(11), Format("x")

Wait time for the new thread.

OldThreadId

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(2), Format("x")

Previous thread ID.

OldThreadPriority

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(4)

Thread priority of the previous thread.

OldThreadState

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(9)

State of the previous thread. The following are the possible state values:

State Description
0 Initialized
1 Ready
2 Running
3 Standby
4 Terminated
5 Waiting
6 Transition
7 DeferredReady (added for Windows Server 2003)

OldThreadWaitIdealProcessor

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(10), Format("x")

Ideal wait time of the previous thread.

OldThreadWaitMode

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(8)

Wait mode for the previous thread. The following are the possible values:

State Description
0 KernelMode
1 UserMode

OldThreadWaitReason

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(7)

Wait reason for the previous thread. The following are the possible values:

State Description
0 Executive
1 FreePage
2 PageIn
3 PoolAllocation
4 DelayExecution
5 Suspended
6 UserRequest
7 WrExecutive
8 WrFreePage
9 WrPageIn
10 WrPoolAllocation
11 WrDelayExecution
12 WrSuspended
13 WrUserRequest
14 WrEventPair
15 WrQueue
16 WrLpcReceive
17 WrLpcReply
18 WrVirtualMemory
19 WrPageOut
20 WrRendezvous
21 WrKeyedEvent
22 WrTerminated
23 WrProcessInSwap
24 WrCpuRateControl
25 WrCalloutStack
26 WrKernel
27 WrResource
28 WrPushLock
29 WrMutex
30 WrQuantumEnd
31 WrDispatchInt
32 WrPreempted
33 WrYieldExecution
34 WrFastMutex
35 WrGuardedMutex
36 WrRundown
37 MaximumWaitReason

PreviousCState

Data type: uint8

Access type: Read-only

Qualifiers: WmiDataId(5)

The index of the C-state that was last used by the processor. A value of 0 represents the lightest idle state with higher values representing deeper C-states.

Reserved

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(12)

Reserved.

SpareByte

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(6)

Not used.

Remarks

These events produce a high volume of events.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]

See also

Thread

Thread_V2

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。