COMPARISON OF ALGORITHMS

Let's Explore

Image

 

Advantages of the algorithms:

  1. FCFS:
    • First Come First Serve algorithm has a very simple logic, it executes the process requests one by one in the sequence they arrive.
    • In FCFS eventually, each and every process gets a chance to execute, so no starvation occur.
  2. SSTF:
    • The total seek time is reduced compared to First Come First Serve.
    • SSTF improves and increases throughput.
  3. SCAN:
    • Scan scheduling algorithm is simple and easy to understand and implement.
    • Starvation is avoided in SCAN algorithm.
  4. CSCAN:
    • C-SCAN Algorithm is the successor and the improved version of the SCAN scheduling Algorithm.
    • The waiting time for the cylinders which were just visited by the head is reduced in C-SCAN compared to the SCAN Algorithm.
  5. LOOK:
    • If there are no requests left to be services the Head will not move to the end of the disk unlike SCAN algorithm.
    • Starvation is avoided in LOOK scheduling algorithm.
  6. CLOOK:
    • In C-LOOK the head does not have to move till the end of the disk if there are no requests to be serviced.
    • C-LOOK provides better performance when compared to LOOK Algorithm.
  7. LIFO:
    • Last In First Out algorithm has a very simple logic, it executes the process requests one by one in the reverse sequence they arrive.
    • In LIFO eventually, each and every process gets a chance to execute, so no starvation occur.

Image

 

Disadvantages of the algorithms:

  1. FCFS:
    • This scheduling algorithm is non-preemptive, which means the process can’t be stopped in middle of execution and will run it’s full course.
    • The throughput of FCFS is not very efficient.
  2. SSTF:
    • In SSTF there is an overhead of finding out the closest request.
    • In SSTF high variance is present in response time and waiting time.
  3. SCAN:
    • Long waiting time occurs for the cylinders which are just visited by the head.
    • In SCAN the head moves till the end of the disk despite the absence of requests to be serviced.
  4. CSCAN:
    • More seek movements are caused in C-SCAN compared to SCAN Algorithm.
    • In C-SCAN even if there are no requests left to be serviced the Head will still travel to the end of the disk unlike SCAN algorithm.
  5. LOOK:
    • Overhead of finding the end requests is present.
    • Cylinders which are just visited by Head have to wait for long time.
  6. CLOOK:
    • In C-LOOK an overhead of finding the end requests is present.
  7. LIFO:
    • This scheduling algorithm is non-preemptive, which means the process can’t be stopped in middle of execution and will run it’s full course.
    • The throughput of LIFO is not very efficient.

Image

 

Implementation of the algorithm:

Image

 

Output of the algorithm: