◄ Wiki / OS
per-CPU state
Data kept in a separate copy for each processor core, so cores don't step on each other.
On a multi-core system, giving each core its own private copy of certain data (counters, buffers, caches) avoids the contention and locking you'd need if all cores shared one copy. This is a core technique for scalable SMP (multiprocessor) code, since each core touches only its own slot. The trade-off is that reading a global total means summing across all the per-core copies.
See also
- mutual exclusionThe guarantee that only one thread or CPU is inside a given critical section at any moment.
- mutexA lock that lets only one thread into a protected section at a time, putting others to sleep while they wait.