scheduling algorithm

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

Upload: mohammad-ali-khan

Post on 15-Jan-2017

153 views

Category:

Technology


2 download

TRANSCRIPT

Mohammad Ali Khan&

Sadia Afrin

Dept. of Computer Science & EngineeringFaculty of Engineering

University of Development Alternative (UODA)

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

CPU – I/O BURST CYCLE

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

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

TYPES OF CPU SCHEDULING ALGORITHM

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

Priority Scheduling Shortest-Job-First Scheduling

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.

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

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.