1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! macOS-specific CPU detection and thread management - Apple Silicon only.
//!
//! x86_64 macOS is deliberately unsupported so the backend can stay focused on
//! the Apple Silicon topology and QoS behavior we test.
//!
//! This module encapsulates all platform-specific logic for macOS. It provides
//! functionalities for detecting detailed CPU information, managing thread affinity,
//! and setting thread scheduling policies tailored for the macOS environment.
//!
//! ## Submodules
//!
//! - [`affinity`]: Handles pinning threads to specific logical cores and managing
//! thread affinity settings.
//! - [`cpu`]: Contains the core logic for detecting CPU features, topology (sockets,
//! physical cores, logical processors), cache information, and distinguishing
//! between Performance and Efficiency cores using macOS-specific APIs like `sysctl`.
//! - [`scheduling_policy`]: Defines how abstract thread priorities map to
//! macOS-specific scheduling policies (e.g., QoS classes).
//! - [`utils`]: Provides utility functions used across the macOS platform-specific modules,
//! often for interacting with system calls or parsing system information.
compile_error!;
// Thread control + the live sysctl reader are genuinely macOS-only. The
// detection pipeline (`cpu`) is pure logic behind the SysctlSource seam and
// also compiles for tests on other platforms (fixture-driven CI coverage).
pub
pub
pub
pub