pub fn count_physical_cores() -> u32
Count the number of physical cores available. Uses sched_getaffinity so should take into account CPU affinity and cgroups.
sched_getaffinity