In practice, when is useful?

Has anyone used core_affinity - Rust or similar crates? (specify that certain threads have affinity for certain cores).

If so, what was the situation, and what was the performance gain it provided ?

It can be use to build something like this, though the gloomio seems to call the libc directly.

1 Like

While I have never used this, my understanding is that some CPUs (primarily in mobile phones) have some cores that are more performant than others. It reasonably follows that you might want your code to run on a specific one.

I failed to state this in original question, but I was more thinking the server case where certain RAM sticks are closer to some CPU sockets, and DRAM access may or may not be uniform. That together with the high costs of thread context switching / flushing parts of of L1 / L2 / L3 caches.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.