10.5: New thread affinity API for OS X developers

Dec 13, '07 07:30:00AM

Contributed by: sveiki

This hint is for all those OS X developers out there. I've been bothered for a while that OS X didn't export thread affinity scheduling to user-space. That is, the functionality for a programmer to tell the system that a particular thread should run on a particular processor core was not available.

With Leopard, Apple has released a Thread Affinity API to provide thread affinity hints to the kernel scheduler for improving data locality in caches, among other uses. While it is still not a full implementation like sched_setaffinity() is in Linux, it should make parallel programming a little bit more effective and portable.

Details on the API can be found here.

[robg adds: Clearly outside the realm of my skill set, but perhaps useful to a few of our readers...]

Comments (0)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20071130131843289