Operating system
1 / 13

Operating System - PowerPoint PPT Presentation

  • Uploaded on

Operating System. U2M3 Lecture 4 Process Management – Scheduling Algorithms. Objectives. Explain the purpose of scheduling List scheduling Criteria Discuss types of scheduling algorithms. Scheduling Algorithm. The scheduling algorithm is a part of the operating system that

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Operating System' - lucky

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Operating system

Operating System

U2M3 Lecture 4

Process Management –

Scheduling Algorithms


  • Explain the purpose of scheduling

  • List scheduling Criteria

  • Discuss types of scheduling algorithms

Scheduling algorithm
Scheduling Algorithm

  • The scheduling algorithm is a part of the operating system that

    • decides which processes should be running on the CPU (in what order) and for how long.

    • Maximizes CPU utilization – keep the CPU as busy as possible

Context switching
Context Switching

  • A context switch (a process switch / a task switch) is the switching of the CPU from one process to another

Scheduling concerns criteria
Scheduling Concerns / Criteria

  • Throughput – Number of processes that complete their execution per time unit

  • Turnaround time – amount of time to execute a particular process

  • Waiting time – amount of time a process has been waiting in the ready queue

  • Response time – amount of time it takes from when a request was submitted until the first response is produced.

Non pre emptive and pre emptive scheduling algorithms
Non-pre-emptive and pre-emptive Scheduling algorithms

A non-pre-emptive (Atomic) algorithm runs a process to completion once it has the CPU.

A pre-emptive algorithm gives each process a time slice (Quantum) and then switching the CPU's attention among the processes. (process switching /context switching)

Each process is allowed to execute for no longer than one time slice so a job may be require many time slices.

Scheduling algorithms
Scheduling Algorithms

  • First come first served (FCFS)

  • Shortest job first;

  • Round Robin ;

First come first served fcfs non pre emptive
First Come First Served(FCFS) non-pre-emptive

  • Processes are dispatched according to their arrival time on the ready queue. Being a non-pre-emptive discipline, once a process has a CPU, it runs to completion.

  • The FCFS scheduling not optimal

    • long jobs make short jobs wait and

    • unimportant jobs make important jobs wait.

Shortest job first sjf non pre emptive
Shortest Job First (SJF) non-pre-emptive

  • Shortest-Job-First (SJF) is an algorithm in which waiting job (or process) with the smallest estimated run-time-to-completion is run next.

  • The SJF scheduling is especially appropriate for batch jobs for which the run times are known in advance.

  • SJF gives the minimum average time for a given set of processes, it is more optimal than FCFS.

  • The problem with SJF scheme is that it requires precise knowledge of how long a job or process will run,

    • not usually available.

    • rely on user

Shortest remaining time first srtf pre emptive
Shortest Remaining Time First (SRTF) pre-emptive

  • Shortest-Remaining Time First (SRTF) algorithm is a pre-emptive version of SJF.

  • In which if a new process arrives with CPU burst length less than the remaining time of current executing process, the current process is pre-empted. The CPU switches to execute the new process.

Round robin pre emptive
Round Robin pre-emptive

  • This scheduling policy gives each process a slice of time (i.e., one quantum) before being pre-empted.

  • As each process becomes ready, it joins the ready queue.

  • A clock interrupt is generated at periodic intervals.

Round robin pre emptive1
Round Robin pre-emptive

  • When the interrupt occurs, the currently running process is pre-empted, and

  • the oldest process in the ready queue is selected to run next.

  • The time interval between each interrupt may vary.

  • Click to see animation