"Rob R. Ainscough" <ro*****@pacbell.net> schrieb:
Is it possible to assign threads to a specific CPU ID? I'm attempting to
provide performance benefits for 2 and 4 CPU systems and would like to
assign specific threads to a processor, is this possible with .NET?
(Based on a post by Thomas Scheidegger [MVP].)
'Process.ProcessorAffinity'
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessClassProcessorAffinit yTopic.asp>
'ProcessThread.ProcessorAffinity'
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessThreadClassProcessorA ffinityTopic.asp>
'ProcessThread.IdealProcessor'
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessThreadClassIdealProce ssorTopic.asp>
Determining the number of processors:
\\\
Imports System
..
..
..
.... = Environment.GetEnvironmentVariable("NUMBER_OF_PROC ESSORS")
///
..NET 2.0: 'Environment.ProcessorCount'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>