smp
SMP
SMP (Symmetric Multiprocessing) describes a system where multiple identical cores share a single main memory and OS instance, with every core equally capable of running any task. The OS scheduler treats all cores interchangeably. “Symmetric” refers to core equivalence, not memory access cost—caches and coherence still create latency variation within a single socket, and NUMA breaks it further across sockets.
SMP is the standard architecture for multi-core desktops and single-socket servers, contrasting with distributed-memory clusters using MPI.
Example
This example uses all cores in an SMP system for parallel work.
// compile: gcc -fopenmp -O2 -o smp smp.c // run: ./smp // description: utilize all SMP cores for parallel reduction #include <stdio.h> #include <omp.h> int main() { int n = 10000000; int sum = 0; #pragma omp parallel for reduction(+:sum) for (int i = 0; i < n; i++) { sum += i % 1000; } printf("Cores: %d, Sum: %d\n", omp_get_num_procs(), sum); return 0; }
smp.md · Last modified: by 127.0.0.1
