⭐ Symmetric Multiprocessing (SMP)
1. Definition
Symmetric Multiprocessing (SMP) is a computer architecture in which two or more identical processors are connected to a single shared main memory and operate under a single operating system, sharing I/O and memory resources equally.
In SMP, all processors are peers—any processor can execute any task, and the OS can schedule tasks on any processor.
2. Key Features of SMP
- Multiple processors: Two or more identical CPUs.
- Shared memory: All processors have equal access to the main memory.
- Single OS instance: One operating system controls all processors.
- Uniform access time: Memory access time is the same for all processors (unlike NUMA).
- Common I/O subsystem: All processors share the same I/O devices.
3. Benefits of SMP
- Improved performance and throughput: Multiple processors can execute tasks concurrently.
- Scalability: Adding more processors increases system performance (up to limits).
- Reliability and fault tolerance: If one processor fails, others can continue processing (though not fully fault-tolerant).
- Simpler programming model: Single memory space makes it easier to write concurrent programs.
4. Challenges of SMP
- Cache coherency: Each processor typically has its own cache, so mechanisms (like MESI protocol) are needed to maintain consistent data.
- Contention for memory and I/O: Multiple processors accessing the same memory or I/O can cause bottlenecks.
- Synchronization overhead: Threads/processes must be synchronized to avoid race conditions.
- Scalability limits: Performance gain diminishes as the number of processors increases due to contention.
5. Typical SMP Architecture
- Processors (P1, P2, …): Identical CPUs, each with private registers and possibly private cache.
- Shared Main Memory: Single memory accessible by all CPUs.
- System Bus / Interconnect: Connects processors to memory and I/O.
- Operating System: Single OS schedules tasks across all processors.
6. Comparison with Other Architectures
| Feature |
SMP |
NUMA (Non-Uniform Memory Access) |
| Memory Access |
Uniform (same latency for all) |
Non-uniform (different latency) |
| Processors |
Symmetric, peer CPUs |
Nodes with local memory |
| Scalability |
Limited due to bus contention |
Better for large-scale systems |
| Programming Model |
Simpler |
More complex (awareness of memory locality needed) |
7. Example Scenario
- Suppose an SMP system has 4 CPUs and shared memory.
- OS can schedule Thread 1 on CPU1, Thread 2 on CPU2, and so on.
- All threads access shared variables in memory.
- Cache coherency protocols ensure all CPUs see the most recent value of shared variables.
8. Exam-Friendly Summary
- SMP: Multiple identical processors sharing memory and I/O under a single OS.
- Goal: Increase throughput and parallelism for multiple tasks/threads.
- Key challenges: Cache coherency, memory contention, synchronization.
- Advantages: Simplicity, performance, scalability (moderate), reliability.