Skip to main content

online_cpu_count

Function online_cpu_count 

Source
pub fn online_cpu_count() -> usize
Expand description

获取在线 CPU 数量

sysconf 返回 -1 时 fail-closed 回退 1(与 page_size() 的 -1 检查语义对齐: 不得将错误值静默转为巨大 usize)。