I have two similar code thread but performed on different data run on the hyperthreading CPU.
My ASM program create 2 thread by call CreateThread API function two times.
Did I must tell the OS that, "please run my each thread on different CPU to speeding up my program"? Or the OS decided it by itself and my program did not want to concern about it?
Thank.
My ASM program create 2 thread by call CreateThread API function two times.
Did I must tell the OS that, "please run my each thread on different CPU to speeding up my program"? Or the OS decided it by itself and my program did not want to concern about it?
Thank.
You can let the OS decide for itself, which it will usually do a good enough job at. There's also the "SetThreadAffinityMask" which can limit the CPU the thread will be scheduled at, but I'd only recommend you to use this if you have specific needs for it.