- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
SetProcessAffinityMask WinAPI 函数有 dwProcessAffinityMask 参数,其中每一位对应于系统中的单个逻辑处理器。
GetLogicalProcessorInformation WinAPI 函数具有 PSYSTEM_LOGICAL_PROCESSOR_INFORMATION 类型的输出参数 Buffer;此结构的 ProcessorMask 字段是“标识此结构描述的处理器的处理器掩码”。
是否可以保证这两个掩码中的位索引表示相同(对应于相同的逻辑处理器)?
我在 MSDN 上找不到任何明确的信息。
最佳答案
A process affinity mask is a bit vector in which each bit represents a logical processor on which the threads of the process are allowed to run.
SYSTEM_LOGICAL_PROCESSOR_INFORMATION不是很清楚:
ProcessorMask The processor mask identifying the processors described by this structure. A processor mask is a bit vector in which each set bit represents an active processor in the relationship.
但是GetLogicalProcessorInformation提供更好的信息:
Each of the SYSTEM_LOGICAL_PROCESSOR_INFORMATION structures returned in the buffer contains the following:
•A logical processor affinity mask, which indicates the logical processors that the information in the structure applies to.
所指的逻辑处理器关联掩码是 ProcessorMask 成员。
关于c++ - GetLogicalProcessorInformation 和 SetProcessAffinityMask 中亲和掩码中的位索引是否相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16742421/
我是一名优秀的程序员,十分优秀!