all groups > visual c > july 2003 >
You're in the

visual c

group:

CPU Restriction


Re: CPU Restriction Jochen Kalmbach
7/31/2003 10:25:43 PM
visual c:
[quoted text, click to view]

In .NET you can use:
"System.Diagnostics.ProcessThread"-class and the member "ProcessorAffinity"


By the way:
"SetThreadIdealProcessor" does NOT resrict the thread to the specified
processor! It only tells the scheduler to use this processor as often as
possible!!!

The correct API is "SetThreadAffinityMask"



--
Greetings
Jochen

Do you need a memory-leak finder ?
CPU Restriction Ashish
7/31/2003 11:25:13 PM
Hi Friends,
Is there any way I can restrict a thread to be processed by only (one / )
certain number of CPUs in a multi CPU machine in .net framework ? I found
the equivalent functions in win32 api (SetThreadIdealProcessor and
GetSystemInfo). Problem is I want to use threads from within .NET framework
and not the old MFC way..
Thanks
Ashish


AddThis Social Bookmark Button