The Dominant Model: Shared Memory Multiprocessing
The multicore shift discussed earlier in this series, moving away from single fast cores due to the power wall, produced processors where multiple cores sit on the same chip and share access to the same main memory. This design is called a Shared Memory Multiprocessor, and it is by far the most common parallel architecture in consumer and server hardware today.
Why Shared Memory Simplifies Programming
In a shared memory system, any core can directly read or write any location in main memory, using the same address space every other core uses. This is a significant advantage for programmers compared to systems where each processor has entirely separate memory, since data can be shared between threads simply by having them access the same memory address, relying on the cache coherence mechanisms discussed earlier in this series to keep every core's view consistent.
Uniform Memory Access (UMA)
In a UMA (Uniform Memory Access) design, every core experiences the same access latency to any location in main memory, regardless of which specific core is making the request. This design is conceptually simple, but scaling it to a very large number of cores becomes difficult, since all cores compete for access to the same shared memory pathways.
Non-Uniform Memory Access (NUMA)
A NUMA (Non-Uniform Memory Access) design addresses this scaling problem by physically dividing memory into regions, each located closer to a specific group of cores. A core can access memory in its own nearby region faster than memory located near a different group of cores, even though the entire memory space still appears as one unified address space to software.
UMA:
All cores ↔ single shared memory,
same latency regardless of which core accesses it
NUMA:
Core Group A ↔ Local Memory A (fast access)
Core Group B ↔ Local Memory B (fast access)
Core Group A ↔ Memory B (slower, cross-region access)NUMA designs scale to far larger numbers of cores than UMA, at the cost of requiring software, and sometimes the programmer explicitly, to be aware of which memory region is "closer" for best performance.
Coordinating Work Across Cores
Regardless of whether a system uses UMA or NUMA, the operating system plays a central role in coordinating parallel execution: assigning different threads to different cores, migrating threads between cores as needed for load balancing, and relying on the synchronization primitives discussed earlier in this series, such as atomic instructions and locks, to ensure threads correctly coordinate access to shared data.
Why Understanding This Distinction Matters
Software written without any awareness of memory locality can perform noticeably worse on NUMA systems if threads frequently access memory located far from the core they are running on. Operating systems and performance-conscious software increasingly take NUMA topology into account explicitly, placing a thread's data in memory physically close to the core most likely to access it.