List scheduling in Operating System

Prerequisite – CPU Scheduling

List Scheduling also know as Priority List Based Scheduling is a scheduling technique in which an ordered list of processes are made by assigning them some priorities.

So, basically what happens is, a list of processes that are ready to be executed at a given point is made. And then depending on the availability of processors i.e, whether they are free or busy, if processors are free they pick the processes and execute them.

Let us now understand the List Scheduling using one example.

Example:
Suppose we have 7 processes P1, P2, P3, P4, P5, P6, P7 such that –



  1. P3 is dependent on P1 and P2 (P3 can start its execution only when both P1 and P2 completes its execution.).
  2. P4 is dependent on P3 and P6 (P4 can start its execution only when both P3 and P6 completes its execution.).
  3. P6 is dependent on P5.

Dependencies are shown below in the figure.

Lets us assume that we have constraint of two processors and we are having both processors free.
Since P1, P2, P5, P7 are independent, lets us assume are they are initially waiting in the ready list and are ready for execution.

Step by step execution of the processes :

  1. We have only two free processors, so let P1 and P2 gets executed first.
  2. P1 and P2 goes out of ready list and P3 comes in ready list. So P3, P5, P7 are in ready list now
  3. Lets assume out of 3 processes present in ready queue, P3 and P5 gets executed next, so P3 and P5 goes out of ready list and P6 comes in ready list. P4 will not come in ready list because it depends on P6 also which is not executed yet.
  4. P6 and P7 are in ready list now. So P6 and P7 gets executed next.
  5. P6 and P7 goes out of ready list and P4 comes in ready list and finally P4 gets executed and all the processes terminates .

Ready list is shown below at each step is shown in figure:

So you can see that after 4 unit time the whole processes gets executed. But this time may vary depending upon the scheduling mechanism operating system is using.

Explanation showing execution time depends on scheduling algorithms used.

  1. Consider the case when same process starts with execution of P5 and P7 first this time instead of P1 and P2 .
  2. After that P5 and P7 comes out of ready list and P6 comes into ready list.
  3. P1, P2, P6 are in ready list now. Let P2 and P6 gets executed.
  4. P2 and P6 comes out of ready list. P1 gets executed then.
  5. P1 comes out of ready list and P3 comes in the ready list and then P3 gets executed.
  6. Finally P4 gets executed and all processes get executed.

Ready list for this process is shown below:

So you can see this time that 5 units of time are taken if we change the order of processes in which they gets executed.

The priorities are determined statically before scheduling process begins. The first step chooses the process with the highest priority, the second step selects the best possible resource. Some of the scheduling strategies that can be used are:

  • Longest path algorithm
  • Longest processing time
  • Critical path method

Goal of algorithm is to maximize CPU utilization and minimize the delay.So whichever Scheduling algorithm helps to achieve this can used depending on the processes.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.