Top Banner
Mohammad Ali Khan & Sadia Afrin Dept. of Computer Science & Engineering Faculty of Engineering University of Development Alternative (UODA)
11

Scheduling Algorithm

Jan 15, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Scheduling Algorithm

Mohammad Ali Khan&

Sadia Afrin

Dept. of Computer Science & EngineeringFaculty of Engineering

University of Development Alternative (UODA)

Page 2: Scheduling Algorithm

Maximum CPU utilization obtained with multiprogramming.

Scheduling :- A method of assigning CPU to a process.

Scheduling is the basis of multi-programmed OS.

BASIC CONCEPTS

Page 3: Scheduling Algorithm

CPU – I/O BURST CYCLE

Page 4: Scheduling Algorithm

1. When A process switches from the running state to waiting state ( due to an I/O request ).

2. When A process switches from the running state to ready state ( due to end of time slice ).

3. When A process switches from the waiting state to ready state ( at completion of I/O ).

4. When A process terminates.

CPU SCHEDULER

Page 5: Scheduling Algorithm

CPU Utilization – Keep the CPU as busy as possible.

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, not output (for time-sharing environment).

SCHEDULING CRITERIA

Page 6: Scheduling Algorithm

TYPES OF CPU SCHEDULING ALGORITHM

First-Come-First-Served Scheduling Round-Robin Scheduling

Priority Scheduling Shortest-Job-First Scheduling

Page 7: Scheduling Algorithm

PRIORITY SCHEDULING

► A priority number (integer) is associated with each

process.

► Smallest integer ≡ Highest priority.

► The CPU is allocated to the process with highest priority.

► Can be Preemptive or Non-preemptive.

► Equal priority processes are scheduled on FCFS.

Page 8: Scheduling Algorithm

Process Priority Burst time (ms) P1 3 10 P2 1 1 P3 3 2 P4 4 1 P5 2 5

P2 P5 P1 P3 P40 1 6 1

618 1

9Chart 1

Average waiting time = (6+0+16+18+1) / 5 = 41/5 =8.2 ms

PRIORITY SCHEDULING

Page 9: Scheduling Algorithm

PRIORITY SCHEDULING

DISADVANTAGES ►If system eventually crashes, all low priority processes get lost.► Indefinite blocking or Starvation.

ADVANTAGES ► Aging :- As time increases , increase in the priority of a process.► Simplicity.► Suitable for applications with varying time and resource requirement.

Page 10: Scheduling Algorithm
Page 11: Scheduling Algorithm