LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

threads, processes and dual core processors

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(3,235 Views)

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.


0 Kudos
Message 2 of 3
(3,229 Views)
Solution
Accepted by topic author OZI

GREAT, thanks I will try it.

 

Greetings

Oliver

0 Kudos
Message 3 of 3
(3,226 Views)