What is Multiprocessor Scheduling?
Multiprocessor Scheduling is a CPU scheduling method used in systems with more than one processor (CPU core). The goal is to efficiently assign processes to multiple processors so that the system performs better and faster.
In single-processor systems, only one process runs at a time.
In multiprocessor systems, multiple processes can run in parallel, so we need a strategy to:
Types of Multiprocessor Systems
1. Symmetric Multiprocessing (SMP)
-
All processors are identical.
-
Share memory and run the same OS.
-
Each processor can schedule any process from the common ready queue.
Most common in modern systems (e.g., multicore CPUs).
2. Asymmetric Multiprocessing (AMP)
Simpler but less efficient; used in some embedded systems.
Scheduling Approaches
1. Centralized Scheduling
-
Single scheduler manages all processors.
-
Processes are in a shared ready queue.
-
OS assigns processes to whichever processor is free.
Pros: Simple, fair load distribution
Cons: Bottlenecks if many processors
2. Distributed Scheduling
Pros: Scalable
Cons: Load imbalance possible
3. Load Balancing
4. Processor Affinity (CPU Affinity)
Example Scenario
Let’s say we have:
-
3 processes: P1 (burst=4), P2 (burst=6), P3 (burst=3)
-
2 processors: CPU1 and CPU2
Centralized Scheduling (Shared Queue)
-
Time 0: P1 → CPU1, P2 → CPU2
-
When P1 finishes (at time 4), assign P3 to CPU1
Result:
Advantages of Multiprocessor Scheduling
Faster execution through parallelism
Better CPU utilization
Improved responsiveness for users
Can run more processes simultaneously
Challenges