Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Dominant Logical Processor?

ravenous_wolves
Beginner
434 Views

For a hyper-threaded core, does one logical processor have a dominance over the other one?

If a high-priority thread is running on one of the logical processors, can it have it's CPU resources stolen by a low-priority thread running on the other logical processor of the same core?

Thanks,

-ken

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
434 Views

Yes.

The priority relates only to priority of being scheduled to run. If 2 threads are runable on a single processor with HT then both threads will run regardless of priority. Both running threads will have approximately the same resources available wether used or not. An HT system has two integer execution units, one floating point pipeline, one cache system, one memory bus. Depending on the mix of integer and floating point and cache activity it is possible that one of the threads (either one) could get much more work done than the other thread. With more than two runable threads, the lower priority thread gets run less often (and/or for shorter durations).

Additional information. If you wrote the multi-threaded application for use on an HT system (no 2nd processor with HT) and you have 2 compute bound threads, the low priority busy looking (waiting) for things to do, then consider inserting a call to _mm_pause(); in the "looking for things to do" loop. On the other hand, if your compute application has but one thread, and some other process is running on the system which is eating up computation time then add a thread to your compute bound application (or write a seperate program) that runs as high (elevated)priority and does little but call _mm_pause();. What this will do is essentially occupy one of the HT threads for the duration of the application.

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
434 Views
I mean No to the 1st question, Yes to the 2nd
0 Kudos
TimP
Honored Contributor III
434 Views
As an example, Windows 2000 would never give a working thread full resources, as it did not recognize the need to pause an idle process running on the other HT thread. So, it was necessary to disable HT in order to get full single thread performance.
0 Kudos
Reply