Jump to content

Talk:Processor affinity

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Old information, maybe?

[edit]

"For example, a system with two dual-core hyper-threaded CPUs presents a challenge to a scheduling algorithm. " in the Usage section. Is it still true? Nowadays practically all processors are multicore and multithreaded, at least for PCs and smartphones. Someone who actually has knowledge on computer science needs to update this, because I'm not qualified enough.Felipe lorenzzon (talk) 13:43, 8 June 2021 (UTC)[reply]

Just because something is common doesn't mean it's not a challenge. It may be a challenge for which there are now known solutions, but those solutions may still require complicated code.
The full quote is

Also note that processor affinity becomes more complicated in systems with non-uniform architectures. For example, a system with two dual-core hyper-threaded CPUs presents a challenge to a scheduling algorithm.

and a system with two dual-core threaded processors is non-uniform as, in the simplest model, a system with two dual-core two-thread processors has has eight pseudo-CPUs running in parallel, but it really has:
  • two independent CPU chips;
  • on each CPU chip, two separate CPU cores;
  • on each CPU core, the ability to run two threads of control in parallel, in a fashion that usually allows software to treat the two threads of control as two pseudo-CPUs.
A naive scheduler would treat such a system as an eight-way SMP system, scheduling all eight pseudo-CPUs as independent processors. However:
  • the two cores on the same CPU may share some elements, such as a level 2 cache, but two cores on different CPUs don't share as many elements, so running two processes on cores on separate CPUs may differ in performance from running two processes on cores on the same CPU;
  • a thread is a pseudo-CPU, with the two threads on a single core share most of the hardware of that core, so running two processes on separate cores may differ in performance from running two processes on two threads of a single core.
and a scheduler might want to take that into account. Guy Harris (talk) 20:51, 8 June 2021 (UTC)[reply]