Expand description
Platform-aware thread QoS and core-affinity binding.
Binds the calling thread to the most appropriate processor class for its workload so the OS scheduler makes the right placement decision:
| Class | macOS QoS | Linux | Windows |
|---|---|---|---|
| UserInteractive | QOS_CLASS_USER_INTERACTIVE | P-cores (affinity) | THREAD_PRIORITY_HIGHEST |
| UserInitiated | QOS_CLASS_USER_INITIATED | P-cores | THREAD_PRIORITY_ABOVE_NORMAL |
| Default | QOS_CLASS_DEFAULT | any | THREAD_PRIORITY_NORMAL |
| Utility | QOS_CLASS_UTILITY | any | THREAD_PRIORITY_BELOW_NORMAL |
| Background | QOS_CLASS_BACKGROUND | E-cores (affinity) | THREAD_PRIORITY_IDLE |
Apple Silicon AMP (P-cores + E-cores) is the primary target. On Intel/AMD/ARM64 the distinction collapses to thread priority.
Enums§
Functions§
- bind_
background_ thread - Convenience wrapper: bind to Background (E-core / idle priority). Call from WAL flush, Merkle DAG, ambient orchestration threads.
- bind_
current_ thread - Bind the calling thread to
class. - bind_
inference_ thread - Convenience wrapper: bind to UserInteractive (P-core / max priority). Call from the LLM inference thread and active SPARQL query thread.
- current_
qos_ class - Read the QoS class of the calling thread. Returns
Noneon non-macOS.