Unit content
Multicore parallelism and thread scheduling
With several processor cores, runnable threads can execute at the same instant rather than merely taking turns on one core.
Concurrency versus parallelism
Concurrency describes overlapping progress. Parallelism means work is physically executing simultaneously.
A multithreaded program can be concurrent on one core and parallel when its runnable threads are scheduled on different cores.
Scheduling across cores
The operating system decides which runnable thread executes on which core. Threads can migrate between cores, and the number of runnable threads can exceed the number of cores.
More threads therefore do not imply proportionally more throughput. Contention, synchronization, memory bandwidth and scheduling overhead can limit scaling.
Shared memory remains shared
Threads of one process still see the same address space while running on different cores. Their memory operations can therefore overlap in real time, making synchronization and the hardware memory system central to correctness and performance.