Doesn't work on macOS Monterey.
Hi,
I've tried the library successfully on Linux but on my development machine running macOS Monterey (version 12.6.3) it doesn't work with version 0.8.0 or 0.8.1 of this crate.
The Vec of available cores returned by core_affinity::get_core_ids() does contain the core I'm trying to pin to but the boolreturned from core_affinity::set_for_current(core_id) is false.
Are there any tricks I need to apply on Mac?
Kind regards, Nicholas
I’ve noticed this on Sonoma on a Apple Silicon Mac as well. In fact tests on this repo catch the error:
running 4 tests
test macos::tests::test_macos_get_core_ids ... ok
test macos::tests::test_macos_set_for_current ... FAILED
test tests::test_get_core_ids ... ok
test tests::test_set_for_current ... FAILED
Seems like Apple Silicon may not support this call (and core pinning may be less useful on this architecture due to all cores sharing a unified cache?). So I guess I’ll just log a warning for now.
Having the same issue on the M1 Max with Ventura 13.2.1. Is there any other way to achieve the same thing?
Apple Silicon likely doesn't support thread affinity due to its heterogeneous architecture, which consists of performance and efficiency cores.