This article has been archived. It is offered "as is" and will no longer be updated.
Source: Microsoft Support
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
An application performs either a Global query or a specific query for Processor performance counter data.
After the query, the calling thread will only run on a single processor, even if there are multiple processors available for the thread to be scheduled on.
This is a known issue in the products listed below.
When an application queries for processor information from the system, many metrics are collected and aggregated in the returned data. One of the metrics is CPU idle time. When collecting this, the system sets the affinity of the requesting thread. It does not, however, reset the affinity of the thread after finishing collecting the idle time data, causing the thread to be affinitized to the processor.
To workaround this issue, the application can reset the affinity of the thread after querying for processor performance counter data. If the application is using native Win32 APIs, it can use the SetThreadAffinityMask API. If the application is using the .NET Framework, it can use the System.Diagnostics.ProcessThread.ProcessorAffinity property to do this. See the More Information section of this article for references on these APIs.
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.