Processor affinity
Processor affinity is a scheduling constraint that restricts a process or thread to one or more specified processors or CPU cores.
Latency
Processor affinity is a scheduling constraint that binds a thread or process to one or more specified processors or CPU cores.
- How it is used
- Uses CPU placement to reduce migration, cache, scheduling, and NUMA-related latency in task-parallel and low-latency applications.
- How deep it goes
- Explains affinity’s cache and NUMA rationale and names POSIX configuration, but stops short of API usage details or measurement procedures.
- Examples
- Uses POSIX pthread_setaffinity_np(), reserved CPUs, background daemons, kernel threads, and interrupts as implementation examples.
- What you can do after
- Operate/configure application threads on selected CPUs and reason about the latency trade-offs of tighter scheduling placement.
Quantization and Fast Inference
CPU affinity is a policy or mechanism that restricts a process or thread to specified processor units.
- How it is used
- Uses CPU pinning experiments to assess how thread placement affects inference throughput.
- How deep it goes
- Measures specific pinning outcomes and relates them to SMT sibling use and cache contention.
- Examples
- Compares pinned placements on an 11-core, 22-vCPU host, reporting throughput of 15.63 and 9.98 tok/s.
- What you can do after
- Evaluate how CPU placement choices affect throughput when threads use physical cores and SMT siblings.
Read how Quantization and Fast Inference explains processor affinity →
Also covered in
What to know first
- threadA thread is a distinct sequence of execution with its own control flow and state, managed or scheduled by a processor, runtime, or operating system.
- CPUA central processing unit (CPU) is a computer processor that executes program instructions and performs general-purpose computational operations.
Related concepts
- threadconfigures · A thread is a distinct sequence of execution with its own control flow and state, managed or scheduled by a processor, runtime, or operating system.
- parallelismuses · Parallelism is the execution of multiple independent tasks or computational operations at the same time rather than sequentially.
- cache invalidationaddresses · Cache invalidation is the process of making cached data unusable when it is no longer valid, typically by removing it or marking it stale.
- simultaneous multithreadingcontrasts with · Simultaneous multithreading is a processor technology that enables multiple hardware threads to share and concurrently use one physical core’s execution resources.
Questions about processor affinity
What is processor affinity?
Processor affinity is a scheduling constraint that restricts a process or thread to one or more specified processors or CPU cores.
Which Manning books explain processor affinity?
Latency and Quantization and Fast Inference.
What should I know before learning processor affinity?
Manning books that teach processor affinity usually introduce thread and CPU first.
What is the difference between processor affinity and thread priority?
Processor affinity is a scheduling constraint that restricts a process or thread to one or more specified processors or CPU cores. Thread priority is a scheduling attribute that influences a thread’s relative eligibility for execution time.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

