11-20-2008 06:47 AM
Hi,
we are using CVI and we want to use multithreading. The application shall run on a dual core processor, so the question came up if it is possible to define on which core the thread is running? Does anyone know if it is possible to start a progam, a process or a thread on a predefined core?
If this is not possible with CVI, is it possible directly with the Windows API?
Thanks
Oliver
Solved! Go to Solution.
11-20-2008 07:42 AM
it is possible using the Windows SDK functions "SetThreadAffinityMask()" and "SetProcessAffinityMask()". the cores on which you want the execution unit to run is specified using a bit mask. "GetProcessAffinityMask()" will tell you which bits are valid for your system. ("GetCurrentProcess()" and "GetCurrentThread()" will return the handle for the current process/thread).
beware that old Intel processors with HyperThreading are considered dual-core by this function.
11-20-2008 08:03 AM
GREAT, thanks I will try it.
Greetings
Oliver