Gang scheduling in operating system

Gang Scheduling Definition

yash dhingra
2 min readNov 3, 2020

“Scheduling of a set of related threads to run on a set of processors at the same time.”

Gang scheduling is a scheduling algorithm for parallel systems that schedules related processes or threads to run simultaneously on different processors. These processes or threads of each job are packed into a single row of the matrix. Gang Scheduling is a combination of time-sharing and space-sharing approaches.

Characteristics of Gang Scheduling are:

(1) threads are grouped into gangs,

(2) threads in a gang are executed simultaneously

(3) time sharing is used among gangs.

Gang scheduling appeared as the solution to the problems of job scheduling policies in those systems where the processor scheduling was a simple dispatch. In this kind of systems, the main problem seems to be the fragmentation, then reasons to use gang scheduling were presented as responsiveness and efficient use of resources All processes belonging to a job run at the same time (the term gang denotes all processors within a job). Each process runs alone on each processor. but there is rapid coordinated context switching. It is possible to suspend/preempt jobs arbitrarily

Gang Scheduling Working:

The different gangs are grouped in time slots following some re-packing algorithm. The total number of processors requested by gangs in a time slot must be less or equal than the total number of processors of the machine. Periodically, at each quantum expiration, the scheduler selects a new time slot to execute all of its gangs. If the workload has changed during the execution of the last quantum, the re-packing algorithm will be re-applied. In any case,the new slot selected is scheduled.