/    /  OS – Multiple Processor Scheduling

Multiple Processor Scheduling

 

The availability of multiple processors makes scheduling more complicated, as there is more than one CPU that has to be kept busy at all times.

Load sharing is used in this case. It can be defined as balancing the load between multiple processors. 

 

Approaches to Multiple processor scheduling:

There are two approaches: Symmetric Multiprocessing and Asymmetric Multiprocessing.

 

  • Symmetric Multiprocessing: In Symmetric Multiprocessing, all processors are self-scheduling. 
  • Asymmetric Multiprocessing: In Asymmetric Multiprocessing, scheduling decisions and I\O processes are handled by a single processor known as the Master Server. 

 

 

Processor Affinity:

In processor affinity, the processes have a priority for the processor which they are running.

 

  • Soft affinity: When the system tries to keep the processes on the same processor.
  • Hard affinity: When the process specifies that it should not be moved between the processors.

 

  

Load Balancing:

Load Balancing is the phenomenon that keeps the workload evenly distributed across all processors in an SMP system so that one processor doesn’t sit idle while the other is being overloaded.

 

  • Push Migration: A task regularly checks if there is an imbalance of load among the processors and then shifts\distributes the load accordingly.
  • Pull Migration: It occurs when an idle processor pulls a task from an overloaded\busy processor. 

 

 

MultiCore Processors:

In MultiCore processors, multiple processor cores are placed on the same physical chip. SMP systems with multicore processors are faster and consume less power than the systems that have a separate physical chip for each processor. 

Though, there are chances of memory stall. Memory stall is the phenomenon where a processor accesses the memory and then spends a significant amount of time waiting for the data to become available. 

To avoid this, a multithreaded processor core is used. 

Two ways to multithread are as follows:

 

  • Coarse-grained multithreading: In this method, when an event like a memory stall occurs, the processor switches to another thread to begin execution. The cost of switching is higher as the instruction pipeline must be terminated before other threads can begin execution.
  • Fine-grained multithreading: In this multithreading, the processor switches between threads at a much finer level, mainly at the boundary of an instruction cycle. The cost of switching is much lower than coarse-grained multithreading. 

 

 

Reference :

Multiple processor Scheduling.