Note that OS X&#x27;s thread affinity APIs, unlike other operating systems, don&#x27;t allow to pin threads to specific processors. You can only define an &quot;affinity set&quot; of threads that should be scheduled on the same processor. Similarly, you can spread threads to different processors by assigning them to different affinity sets.<p>I wrote some code to do this in Firefox for OS X, Linux, and Windows: <a href="https:&#x2F;&#x2F;mxr.mozilla.org&#x2F;mozilla-central&#x2F;source&#x2F;xpcom&#x2F;threads&#x2F;nsThread.cpp#302" rel="nofollow">https:&#x2F;&#x2F;mxr.mozilla.org&#x2F;mozilla-central&#x2F;source&#x2F;xpcom&#x2F;threads...</a>