Comparison of the Various CPU Scheduling Algorithms

Similar documents
Analysis and Comparison of CPU Scheduling Algorithms

A Comparative Study of CPU Scheduling Algorithms

PROCESS SCHEDULING ALGORITHMS: A REVIEW

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Weight-based Starvation-free Improvised Round-Robin (WSIRR) CPU Scheduling Algorithm

CPU Scheduling. CPU Scheduling

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

W4118 Operating Systems. Instructor: Junfeng Yang

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Introduction. Scheduling. Types of scheduling. The basics

ICS Principles of Operating Systems

Operating Systems. III. Scheduling.

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

OPERATING SYSTEMS SCHEDULING

Chapter 5 Process Scheduling

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Operating System: Scheduling

REDUCING TIME: SCHEDULING JOB. Nisha Yadav, Nikita Chhillar, Neha jaiswal

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

A Group based Time Quantum Round Robin Algorithm using Min-Max Spread Measure

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Operating Systems Lecture #6: Process Management

A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems

A Review on Load Balancing In Cloud Computing 1

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

OS OBJECTIVE QUESTIONS

CPU Scheduling Outline

Operating Systems Concepts: Chapter 7: Scheduling Strategies

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

CPU Scheduling. Core Definitions

Processor Scheduling. Queues Recall OS maintains various queues

Job Scheduling Model

Design and performance evaluation of Advanced Priority Based Dynamic Round Robin Scheduling Algorithm (APBDRR)

Scheduling Algorithms

Operating Systems, 6 th ed. Test Bank Chapter 7

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Far-western University Central Office, Mahendranagar Operating System

Analysis of Job Scheduling Algorithms in Cloud Computing

Load Balancing Scheduling with Shortest Load First

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads.

III. SCHEDULING MODEL A. Users: The user enters the jobs to be executed on processor in computational grid.

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Survey on Job Schedulers in Hadoop Cluster

This tutorial will take you through step by step approach while learning Operating System concepts.

Linux Process Scheduling Policy

CS Fall 2008 Homework 2 Solution Due September 23, 11:59PM

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

Real-Time Scheduling 1 / 39

Syllabus MCA-404 Operating System - II

Task Scheduling in Hadoop

Operating System Tutorial

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies

AN EFFICIENT LOAD BALANCING APPROACH IN CLOUD SERVER USING ANT COLONY OPTIMIZATION

Computer Science 4302 Operating Systems. Student Learning Outcomes

International Journal of Computer Science Trends and Technology (IJCST) Volume 2 Issue 4, July-Aug 2014

Roulette Wheel Selection Model based on Virtual Machine Weight for Load Balancing in Cloud Computing

Web Server Software Architectures

Overview of Presentation. (Greek to English dictionary) Different systems have different goals. What should CPU scheduling optimize?

A Comparative Performance Analysis of Load Balancing Algorithms in Distributed System using Qualitative Parameters

International Journal of Advance Research in Computer Science and Management Studies

Performance Analysis of Load Balancing Algorithms in Distributed System

IMPROVEMENT OF RESPONSE TIME OF LOAD BALANCING ALGORITHM IN CLOUD ENVIROMENT

Undergraduate Course Syllabus

Efficiency of Batch Operating Systems

APPENDIX 1 USER LEVEL IMPLEMENTATION OF PPATPAN IN LINUX SYSTEM

A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I DR. S. A. SODIYA

Performance Analysis of VM Scheduling Algorithm of CloudSim in Cloud Computing

A Review of Load Balancing Algorithms for Cloud Computing

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

LOAD BALANCING STRATEGY BASED ON CLOUD PARTITIONING CONCEPT

Scheduling. Monday, November 22, 2004

Types Of Operating Systems

Reallocation and Allocation of Virtual Machines in Cloud Computing Manan D. Shah a, *, Harshad B. Prajapati b

Convenience: An OS makes a computer more convenient to use. Efficiency: An OS allows the computer system resources to be used in an efficient manner.

Improved Hybrid Dynamic Load Balancing Algorithm for Distributed Environment

EFFICIENT SCHEDULING STRATEGY USING COMMUNICATION AWARE SCHEDULING FOR PARALLEL JOBS IN CLUSTERS

Ready Time Observations

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Comparison between scheduling algorithms in RTLinux and VxWorks

OPERATING SYSTEM - VIRTUAL MEMORY

Scheduling policy. ULK3e 7.1. Operating Systems: Scheduling in Linux p. 1

Comparison of Request Admission Based Performance Isolation Approaches in Multi-tenant SaaS Applications

ADAPTIVE LOAD BALANCING ALGORITHM USING MODIFIED RESOURCE ALLOCATION STRATEGIES ON INFRASTRUCTURE AS A SERVICE CLOUD SYSTEMS

Grid Computing Approach for Dynamic Load Balancing

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

The International Journal Of Science & Technoledge (ISSN X)

Study of Various Load Balancing Techniques in Cloud Environment- A Review

LECTURE - 1 INTRODUCTION TO QUEUING SYSTEM

Switch Fabric Implementation Using Shared Memory

Transcription:

Comparison of the Various CPU Scheduling Algorithms Nikhil Selvaraj, Yeshwanth Raja, R. Ajay Adithya, Arjun Narendran Undergraduate Student, Computer Science Department, Sri Venkateswara College of Engineering ABSTRACT Scheduling is a basic operating system function which decides the time and order in which the designated processes have to be executed. The CPU is the most important component of a computer which does the scheduling. CPU scheduling is done by switching the CPU among various processes. The main function of the operating system is to let as many processes as possible execute so that the best possible utilization of the CPU is achieved. In this paper, we review the basic scheduling algorithms and show which algorithm is best for a particular situation. We also modify a particular scheduling algorithm so that the performance in scheduling the processes is improved. Keywords:- Starvation time, Gantt Chart, average waiting time. 1. INTRODUCTION Scheduling is a fundamental operating-system function.almost all computer resources are scheduled before use.the CPU is one of the primary computer resources. Thus,its scheduling is central of operating system design. Whenmore than one process is runnable, the OS must decidewhich one is to run first. That part of the OS concernedwith this decision is called scheduler and the algorithm ituses is called scheduling algorithm. A CPU scheduler is thepart of an operating system and responsible for arbitrating access to the CPU. A scheduler is an OS module thatselects the next job to be admitted into the system and thenext process to run.an operating system has three types of schedulerslongterm scheduler (also known as Job scheduler), mediumtermscheduler and short-term scheduler (also known asdispatcher and CPU scheduler). 1.1Types of schedulers 1.1.a) Long-term scheduler The long-term scheduler (also known as admissionscheduler) decides which jobs or processes are to beadmitted to the ready queue (in the Main Memory); that is,when an attempt is made to execute a program, itsadmission to the set of currently executing processes iseither authorized or delayed by the long-term scheduler.thus, this scheduler dictates what processes are to runon a system, and the degree of concurrency to be supportedat any one time - i.e.: whether a high or low amount ofprocesses are to be executed concurrently, and how thesplit between input output intensive and CPU intensiveprocesses is to be handled. So long term scheduler isresponsible for controlling the degree ofmultiprogramming. In modern operating systems, this isused to make sure that real time processes get enough CPUtime to finish their tasks. Without proper real timescheduling, modern GUIs would seem sluggish. The longterm queue exists in the Hard Disk or the "VirtualMemory" 1.1.b) Medium-term scheduler The medium-term scheduler (also known as mid-termscheduler) may decide to swap out a process which has notbeen active for some time, or a process which has a lowpriority, or a process which is taking up a large amount ofmemory in order to free up main memory for otherprocesses, swapping the process back in later when morememory is available, or when the process has beenunblocked and is no longer waiting for a resource. 1.1.c) Short-term scheduler The short-term scheduler (also known as CPUscheduler) selects from among the pool of process resident in memory that are ready to execute, and allocates the CPUto one of them. Thus the short-term scheduler makesscheduling decisions much more frequent than the longtermor mid-term schedulers. This scheduler can bepreemptive, implying that it is capable of forcibly removingprocesses from a CPU when it decides to allocate that CPUto another process, or non pre-emptive (also known as"voluntary" or "co-operative"), in that case the scheduler isunable to force processes off the CPU. 1.2 Basic terminologies used in CPU scheduling CPU Time: CPU time (or process time) is the amount of time for which the CPU was used for processing instructions of a computer program or operating system, as opposed to waiting for I/O operations or entering low-power (idle) mode. Volume 2 Issue 11 November 2014 Page 18

The CPU time is measured in clock ticks or seconds. It is useful to measure CPU time as a percentage of the CPU's capacity, which is called the CPU usage. CPU time has two main uses. The first use is to quantify the overall busyness of the system. When the CPU usage is above 70%, the user may experience lag. The second use is to quantify how the processor is shared between computer programs. High CPU usage by a single program may indicate that it is highly demanding of processing power or that it may malfunction. The CPU time can be divided into the following: 1. User time is the amount of time the CPU was busy executing code in user space. 2. System time is the amount of time the CPU was busy executing code in kernel space. 3. Idle time is the amount of time the CPU was not busy. 4. Steal time is the amount of time the operating system wanted to execute, but was not allowed to by the hypervisor. Burst Time: Burst time is the amount of time that a process uses the CPU for its execution. It can also be defined as the amount that a process requires between I/O waits. Arrival Time: Arrival time is the time at which the process is ready to be scheduled by the CPU for execution. Waiting time: Waiting time is the amount of time that a process has been waiting in the ready queue. Throughput: Throughput is the number of processes that complete their execution per unit time. 2. REVIEW OF EXISTING ALGORITHMS 2.1Types of scheduling algorithms The various types of scheduling algorithms are: 1. First Come First Serve Scheduling 2. Shortest Job First Scheduling 3. Priority Scheduling First Come First Serve Scheduling: The most intuitive and simplest technique is to allow the first process submitted to run first. This approach is called as first-come, first-served (FCFS) scheduling. In effect, processes are inserted into the tail of a queue when they are submitted. The next process is taken from the head of the queue when each finishes running. The main advantage of this type of scheduling is that it is easy to understand and implement this algorithm. The main disadvantage is that its performance is poor as the average waiting time is high. Shortest Job First Scheduling: The process is allocated to the CPU which has least burst time. A scheduler arranges the processes with the least burst time in head of the queue and longest burst time in tail of the queue. This requires advanced knowledge or estimations about the time required for a process to complete. This algorithm is designed for maximum throughput in most scenarios. The main advantage of this type of scheduling is that the waiting time can be reduced. The disadvantages are that the processor should know in advance how much time each processwill take. Also the implementation is difficult. Priority Scheduling: The OS assigns a fixed priority rank to every process, and the scheduler arranges the processes in the ready queue in order of their priority. Lower priority processes get interrupted by incoming higher priority processes. Its main advantage is that it provides a good mechanism where the relative importance of each process may be well defined. Its disadvantage is that if the process with the higher priority takes up a large amount of time, then the lower priority processes execution will be delayed. 2.2 Computation of Gantt chart, Waiting Time and Turnaround Time Consider the following set of processes, with the length of the CPU-burst time in milliseconds. The Gantt charts for the FCFS and SJF algorithms below are based on table I. Table II gives the Gantt chart for priority scheduling algorithm Volume 2 Issue 11 November 2014 Page 19

TABLE 1 PROCESS WITH ITS ID AND BURST TIME Burst Time (ms) P 1 10 P 2 2 P 3 8 P 4 6 P 1 P 2 P 3 P 4 0 10 12 20 26 Figure II: Gantt chart for FCFS P 2 P 4 P 3 P 1 0 2 8 16 26 FigureIII: Gantt chart for SJF TABLE 2. PROCESS WITH ITS ID, BURST TIME AND PRIORITY Burst (ms) Time Priority P 1 10 3 P 2 2 1 P 3 8 4 P 4 6 2 P 2 P 4 P 1 P 3 0 2 8 18 26 Figure V: Gantt chart for PS For example, turnaround time for the process is calculated as time of submission of a process to the time of completion of the process is obtained through Gantt chart for SJF scheduling. Turnaround time for process P 1, P 2, P 3 and P 4 is observed as 26, 2, 16 & 8 and average turnaround time is (26+2+16+8)/4=13 ms. The waiting time for the process is calculated as time taken by the process to wait in the ready queue is observed from Gantt chart for SJF scheduling. Waiting time for process P 1, P 2, P 3 and P 4 is obtained as 16, 0, 8 & 2 respectively and average waiting time is (16+0+8+2)/4 = 6.5 ms. Similarly the turnaround time and waiting time is calculated for all other algorithms and summarized in Table III and Table IV. From the above discussion it is clear that First Come First Serve (FCFS) & Shortest Job First (SJF) is generally suitable for batch operating systems & Priority Scheduling (PS) is suitable for time sharing systems. SJF algorithm is optimum for all type of scheduling algorithm. Hence, it is an algorithm with an optimum criteria and suitable for all scenarios. Volume 2 Issue 11 November 2014 Page 20

3.PROPOSED ALGORITHM Improvement to Shortest Job First Algorithm: In the normal shortest job first algorithm, the processes are executed in the increasing order of their burst times. If this happens, the process with the longest burst time will have to wait till all the other processes with shorter burst times get executed. Therefore, the starvation time will be more and the CPU utilization is not efficient. In order to avoid this, a significant improvement that can be made is to execute a long process after 60% of all the other shorter processes have finished execution. This will guarantee that the longest process gets executed at some time rather than the process s execution being delayed till the last. This in turn ensures effective CPU utilization. Burst Time (ms) P 1 10 P 2 2 P 3 8 P 4 6 Figure III: Gantt Chart for SJf From the above Gantt chart, the waiting times for processes P1, P2, P3 and P4 are 8, 0,18 and 2 respectively. The average waiting time is (0+2+8+18)/4=7. It is also clear that the finishing time reduces since here the finishing time is 24 ms while in the normal algorithm it is 26 ms.the starvation time reduces in this case since the waiting time of process P1 is only 8 ms while in the normal algorithm it is 16 ms. 4. RESULTS The fundamental scheduling algorithm has been simulated and justified with C++ code. Comparison of the fundamental algorithm is shown in Figure VI and Figure VII. i. Waiting Time Figure VI: Comparison of Fundamental scheduling Algorithm-Waiting Time Volume 2 Issue 11 November 2014 Page 21

ii. Turnaround Time Figure VII: Comparison of Fundamental scheduling Algorithm-Turnaround Time It is clearly observed that turnaround time, waiting time and response time of the processes are optimum for SJF scheduling algorithm compared to all other fundamental algorithms from Figure II, Figure. III, Fig. IV, Fig. V, (Figure II to Figure V are Gantt Chart) Figure VI and Figure VII. It can also be observed that throughput and CPU utilization rate are optimum. From above analysis and discussion, we can say that the FCFS is simple to understand and suitable only for batch system where waiting time is large. SJF scheduling algorithm gives minimum average waiting time and average turnaround time. The priority scheduling algorithm is based on the priority in which the highest priority job can run first and the lowest priority job need to wait though it will create a problem of starvation. 5. CONCLUSIONS The SJF scheduling algorithm is to serve all types of job with optimum scheduling criteria. The treatment of shortest process in SJF scheduling tends to result in increased waiting time for long processes. And the long process will never get served, though it produces minimum average waiting time and average turnaround time. The shortest job first scheduling algorithm deals with different approach, in this algorithm the major benefit is it gives the minimum average waiting time. The drawbacks of the shortest job first scheduling algorithm can be overcome by the technique proposed above in which after 60% of all the processes have executed, the longest process gets executed. The only way to evaluate a scheduling algorithm to code it and has to put it in the operating system, only then a proper working capability of the algorithm can be measured in real time systems. REFERENCES [1] Abraham Silberschatz, Peter Baer Galvin, Greg Gangne; Operating System Concepts, edition-6, 2002, John Wiley and Sons, INC. [2] Mr. Sindhu M, Mr. Rajkamal R and Mr. Vigneshwaran P, An Optimum Multilevel CPU Scheduling Algorithm. 978-0-7695-4058-0/10 $26.00 2010 IEEE [3] Mr. Umar Saleem and Dr. Muhammad YounusJaved, Simulation of CPU Scheduling Algorithm, 0-7803-6355-8/00/ $10.00 @ 2000 IEEE. [4] Sun Huajin, GaoDeyuan, Zhang Shengbing, Wang Danghui; Design Fast Round Robin Scheduler in FPGA, 0-7803-7547-5/021/$17.00 @ 2002 IEEE. [5] Md. Mamunur Rashid and Md. NasimAdhtar; A New Multilevel CPU Scheduling Algorithm, Journals of Applied Sciences 6 (9): 2036-2039, 2009. [6] Mr. Sindhu M, Mr. Rajkamal R and Mr. Vigneshwaran P, An Optimum Multilevel CPU Scheduling Algorithm. 978-0-7695-4058-0/10 $26.00 2010 IEEE [7] Black, D.L., 1985. Scheduling support for concurrency and parallelism in the mach operating system. Computer, 23:123-126. [8] AnkurBhardwas, Rachhpal Singh, Gaurav, Comparative Study of Scheduling Algorithm in Operating System International Journal of Computer and Distributed Systems, Vol. No. 3, Issue I, April-May Volume 2 Issue 11 November 2014 Page 22