You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I prevent core 3 (I have 4 cores numbered: 0..3) from being used by anything else on the system by adding isolcpus=3 to my kernel command line parameters.
On reboot this is OK. 'top' shows all 4 cores, with core 3 100% idle. This is as hoped for.
Next I want to run my rust program on core 3 only.
core_affinity::get_core_ids() only returns 3 elements, not 4.
The missing element is for core 3 so I can't then
core_affinity::set_for_current().
This makes it impossible to do what I wanted (run my rust app on its own isolated core).
Does this point to an issue with core_affinity::get_core_ids()? I expected it to return 4 elements.
Thanks for your help. Cheers.
The text was updated successfully, but these errors were encountered:
A bit more effort and I see that a CoreId is simply a...
pub struct CoreId {
id: usize,
}
So I can achieve want with this:
core_affinity::set_for_current(core_affinity::CoreId{id:3});
Thanks for your crate. It works for me now. Maybe it could be improved by core_affinity::get_core_ids() returning all the cores irrespective of the any isolcpus setting?
I'm no longer maintaining this crate. A far more comprehensive, Linux aware crate for cores, hyperthreads and NUMA nodes is https://github.com/lemonrock/linux-support .
I prevent core 3 (I have 4 cores numbered: 0..3) from being used by anything else on the system by adding isolcpus=3 to my kernel command line parameters.
On reboot this is OK. 'top' shows all 4 cores, with core 3 100% idle. This is as hoped for.
Next I want to run my rust program on core 3 only.
core_affinity::get_core_ids() only returns 3 elements, not 4.
The missing element is for core 3 so I can't then
core_affinity::set_for_current().
This makes it impossible to do what I wanted (run my rust app on its own isolated core).
Does this point to an issue with core_affinity::get_core_ids()? I expected it to return 4 elements.
Thanks for your help. Cheers.
The text was updated successfully, but these errors were encountered: