Professional Documents
Culture Documents
Chapter - I: Implementation of Fcfs SJF SRT Cpu Scheduling Algorithm in Java
Chapter - I: Implementation of Fcfs SJF SRT Cpu Scheduling Algorithm in Java
Chapter I Introduction
1.1 INTRODUCTION
CPU SCHEDULING
It is the task of selecting a waiting process from the ready queue and allocating the CPU to it. It is a fundamental problem in operating systems in terms of minimizing the wait for the user when he or she simply wants to execute a particular set of tasks. In order to make the computer more productive in multiprogramming, the operating system needs to switch the CPU among processes
Overview
Scheduling algorithm CPU Utilization Throughput Turnaround Response Deadline handling Starvation free time time
Low
Low
High
Low
No
Yes
High
Medium
Medium
No
No
Medium
Low
High
High
Yes
No
Round-robin scheduling
High
Medium
Medium
Low
No
Yes
Different algorithms are used for CPU scheduling. Such as FIRST-COME FIRST-SERVED SHORTEST-JOB-FIRST SHORTEST REMAINING TIME ROUND ROBIN PRIORITY SCHEDULING MULTILEVEL QUEUE SCHEDULING
2.1 LITERATURE Traditionally, real time operating systems (RTOS) use scheduling mechanisms that Can provide predictable latency. Although this is a desirable property, attempts to Duplicate these designs in general purpose operating systems have not been fruitful (Geol. et al. 2004 [10]). General purpose operating systems have taken a different path in the development of schedulers. According to Goel et al. (2004) [10], Priority Scheduling assumes that the CPU needs of each thread are known and that the highest Priority thread voluntarily yields the CPU. Central processing unit (CPU) scheduling is the mechanism by which operating Systems (OS) allocate the CPU resources to processes. Scheduling is required for Multiprogramming, and it is one of the fundamental OS activities (As, 2005 [1]; Bar, 2000 [3]; Bovet and Cesati, 2003 [5]; Carpenter et al. [7]; Gorman, 2004 [11]; Love, 2004 [17]; Martin, 1999 [20]; Rinard, 1998 [28]; Silberschatz, 1998 [29]; Tannenbaum, 1992 [31]). Because, a scheduler aims to keep the CPU and input/ output (IO) systems as busy as possible, by overlapping processes undergoing IO bursts with processes undergoing CPU bursts, a process executed from bad or malicious code can affect the behavior of a scheduler and hence cripple computing (Kolivas, 2004 [13]; Martin, 1999 [20]; Miyoshi and Rajkumar, 2001 [21]; Oguma and Nakayama, 2001 [22]; Oyvind, 2004 [23]; Park and Choe, 2002 [24]; Regehr, 2002 [26]). The aim of a good scheduling algorithm is to maximize CPU utilization, CPU throughput, and scheduler efficiency; and to minimize queue turn-around-time, pro1 cess wait time, perceived response time, and variation in response times. The idea behind scheduling is based on a number of facts. First, process execution involves a cycle of alternating bursts. Second, CPU burst times cluster sharply. Third, CPUbound processes have many long CPU bursts. Last, IO-bound processes have many short IO bursts.
3.1 PROBLEMS Although context-switching is a desirable feature of OS CPU schedulers, it introduces dispatch latency. Excessive context-switching increases scheduler overheads. The current designs of scheduler algorithms allow bad or malicious code to exploit scheduler run time characteristics and induce high dispatch latency, keeping the scheduler perpetually busy and driving down CPU utilization.
Chapter IV Methodology
4.1 Software Hardware Requirement JAVA The Software Requirements are JAVA, MS EXCESS, Windows XP, Vista. The Hardware Requirements are minimum 512 MB RAM, centrino duo processor 4.2 SRS Document 4.2.1 Introduction 4.2.1.1 Purpose of this document To schedule the operating system process based on the fcfs, sjf,srtalgorithm s 4.2.1.2 Scope of this document The scope of this study was limited to the Linux scheduler and the Preemptive priority scheduling algorithm. At the evaluation phase, performance and stability characteristics were compared with those of the Linux 2.6.11 CPU scheduler. The C programming language was used in the development of the scheduler prototype. C has many desirable features, however there was not much of a choice since this is the language of the Linux kernel (Linen, 2000 [15]). The software development and tests were carried out on a single processor Intel architecture based personal computer.
4.2.1.3 Definitions, Acronyms and Abbreviations Srs Software Requirement Specification User a person who will be using the system for its intended purpose FCFS-First Come First Serve SJF-Shortest Job First SRT-Shortest Remaining Tim
The goals are: The goal is developa model CPU scheduler to guard against runway dispatch latency, and gurantee a optimum level of scheduler effiency 4.2.1.5 Overview 4.2.2 General Description
The remaining part of this document follows the IEEE STD 830-1993 format. Section 3 will cover the product perspective, functions, user characteristics, constraints and assumptions. Section 4 will cover the functional and non-functional requirements. Section 5 will cover the operational requirements.
4.2.2.1 Product Perspective The system will be developedusing JAVA 4.2.2.2 Product Functions To schedule the proceses of operating system CPU 4.2.2.3 User characteristics User will enter the number of process to be schedule, bursttime, arrival time 4.2.3 Requirements 4.2.3.1 Functional Requirements The user should be able to schedule the processes 4.2.3.1.1 Operation performed by user 4.2.3.1.1.1 Introduction Scheduling algorithm will schedule the process. 4.2.3.1.1.2 Inputs No. of process , burst time arrival time 4.2.3.1.1.3 Processing These will schedule the process. 4.2.3.1.1.4 Outputs Tur n around time,Average throught put, Waiting Time. 4.2.3.2 Interface Requirements 4.2.3.2.1 User Interfaces 4.2.3.2.1.1 The Command line Screen Input will be provided in command window. 4.2.3.2.1.2. Applet viewer window Output should be shown in this window 4.2.3.2.2 Hardware Interfaces All necessary hardware interfaces will be proided by the developer. 4.2.3.2.3 Software Interfaces The system shal be compatible to work as a applet window based application in JAVA .
4.2.3.3 Performance Requirements Burst time of process Arrival time 4.2.3.4 Design Constraints 4.2.3.4.1 Standard Compliance The IEEE format is used for technical documentation specification in this document. 4.2.3.4.2 Hardware Constraints The software system runs on Windows XP, Vista that requires minimum 1GB RAM and Centrino Duo Processor 4.2.3.4.3 Software Constraints (limitations) The system shall meet all performance requirements running on the JAVA application
LEVEL 0
LEVEL 1
User
Requests
(1) Scheduler
Invokes
Previous
Next
Datasets
Generates
Previous
Next
LEVEL 2
FCFS Output
SJF output
Srt output
6.1 Scope The standard scheduling algorithms FCFS, SJF, RR, and Priority scheduling have formed the basis of industry application of CPU schedulers. The industry implementation of schedulers have employed variations based on flavours and hybrids of the standard algorithms. As with most NP-hard problems, in designing the standard algorithms, scholars did not concern themselves with security matters. They were interested in achieving optimization in certain process scheduling criteria e.g. throughput and responsiveness. Security, as often with software development became an issue when other inquisitive and / or malicious system developers got hold of the finnished products.
6.2 Conclusion Since context-switching is a costly necessity, it is important to keep its frequency to as minimum as possible. Malicious code can induce excessive context-switching by generating successive processes with increasing priorities. Linux implements a preemptive kernel. The most acclaimed advantage of the preemptive kernel is the protection it affords the OS. For instance, system calls are given high priority to enable them to execute ahead of other tasks. In this way they can reset failure points like race conditions and deadlocks. Systems with preemptive kernels have to contend with context-switching. The rational behind this study is that since the rates of both preemption and context-switches can be monitored, then either conditions to allow context-switching or preemption can be tied to the levels of the monitored statistics.
Bibliography