c# - how to set CPU affinity of a program? -
I have written a program in C #, I developed a Windows VSTS 2008 + .NET 3.5 + Windows I am using Vista Enterprise x86. Application of the form.
My current computer is a dual-core CPU, I want to run my program's CPU affinity on a specific CPU and release another CPU for another job. Any ideas how to do this? Either the coding or configuration is fine.
There is a bit more background, my program is CPU intensive, so I do not want to capture all the two CPU resources on my computer and I want to free a CPU so that I can connect to the network at the same time Quickly browse : -)
Thanks in advance, George
- strong> work Manager -> Processes tab.
- Find your program.
- Select Set affinity and uncheck one of the checkboxes.
This should free a processor for you.
You can add this statement to do this by code:
System.Diagnostics.Process.GetCurrentProcess (). ProcessorFactory = (System.IntPtr) 1;
Cheers!
Comments
Post a Comment