CHP-4 QUEUE Cont…. 7.DEQUE Deque (short form of double-ended queue) is a linear list in which elements can be inserted or deleted at either end but not.

Slides:



Advertisements
Similar presentations
CPU Scheduling.
Advertisements

CPU Scheduling.
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
CHAPTER 2 PROCESSOR SCHEDULING PART I By U ğ ur HALICI.
Lecture - 9 On Queues. Prepared by, Jesmin Akhter, Lecturer, IIT,JU QUEUES A Queue is a linear list of elements in which deletions can take place only.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Unit : Overview of Queues.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Scheduling Algorithms
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (2) Process Management 10/03/2008 Yang Song (Prepared by Yang Song and.
Chapter 5-CPU Scheduling
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CHP-4 QUEUE.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Operating Systems CPU Scheduling Algorithms
Introduction Of Queue. Introduction A queue is a non-primitive linear data structure. It is an homogeneous collection of elements in which new elements.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
CPU Scheduling Algorithms CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU SCHEDULING.
Chapter 5a: CPU Scheduling
Algorithm and Data Structure Part III Dr. Naimah Yaakob
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Process Scheduling B.Ramamurthy 4/11/2019.
Uniprocessor scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

CHP-4 QUEUE Cont…

7.DEQUE Deque (short form of double-ended queue) is a linear list in which elements can be inserted or deleted at either end but not in the middle. That is, elements can be inserted/deleted to/ from the rear or the front end. Figure 4.9 shows the representation of a deque.

INSERT OPERATION IN BEGINNING OF DEQUE

INSERT OPERATION AT END OF DEQUE

DELETE OPERATION IN BEGINNING OF DEQUE

DELETE OPERATION AT END OF DEQUE

VARIATIONS OF DEQUE There are two variations of a deque that are as follows: (1)Input restricted deque: It allows insertion of elements at one end only but deletion can be done at both ends. (2)Output restricted deque: It allows deletion of elements at one end only but insertion can be done at both ends. The implementation of both these queues is similar to the implementation of deque. The only difference is that in input restricted queue, function for insertion in the beginning is not needed whereas in output-restricted queue, function for deletion in the beginning is not needed.

7.APPLICATION OF QUEUE There are numerous applications of queue in computer science. Various real-life applica­tions, like railway ticket reservation, banking system are implemented using queue. One of the most useful applications of queue is in simulation. Another application of queue is in operating system to implement various functions like CPU scheduling in multiprogram­ming environment, device management (printer or disk), etc. Besides these, there are several algorithms like level-order traversal of binary tree, etc., that use queues to solve the problems efficiently.

Simulation Simulation is the process of modelling a real-life situation through a computer program. Its main use is to study a real life situation without actually making it to occur. It is mainly used in areas like military, scientific research operations where it is expensive or dangerous to experiment with the real system. In simulation, corresponding to each object and action, there is counterpart in the program. The objects being studied are represented as data and action as operations on the data. By supplying different data, we can observe the result of the program. If the simulation is accurate, the result of the program represents the behaviour of the actual system accurately.

Simulation(Cont.) Consider a ticket reservation system having four counters. If a customer arrives at time t and a counter is free then the customer will get the ticket immediately. However, it is not always possible that counter is free. In that case, a new customer goes to the queue having less number of customers. Assume that the time required to issue the ticket is t. Then the total time spent by the customer is equal to the time t (time required to issue the ticket) plus the time spent waiting in line. The average time spent in the line by the customer can be computed by a program simulating the customer action. This program can be implemented using queue, since while one customer is being serviced, others keep on waiting.

CPU Scheduling in Multiprogramming Environment As we know that in multiprogramming environment, multiple processes run concurrently to increase CPU utilization. All the processes that are residing in memory and are ready to execute are kept in a list referred as ready queue. It is the job of scheduling algorithm to select a process from the processes and allocate the CPU to it. Let us consider a multiprogramming environment where the processes are classified into three different groups, namely, system processes, interactive processes and batch processes. To each group of process, some priority is associated. The system processes have the highest priority whereas the batch processes have the least priority.

CPU Scheduling in Multiprogramming Environment(Cont.) To implement mul­tiprogramming environment, multi-level queue scheduling algorithm is used. In this algorithm, the ready queue is partitioned into multiple queues (see Figure 4.12). The processes are assigned to the respective queues. The higher priority processes are executed before the lower priority processes. For example, no batch process can run unless all the system processes and interactive processes arc executed. If a batch process is running and a system process enters the queue, then batch process would be pre-empted to execute this system process.

Round Robin algorithm The round robin algorithm is one of the CPU scheduling algorithms designed for the time­sharing systems. In this algorithm, the CPU is allocated to a process for a small time interval called time quantum (generally from 10 to 100 milliseconds). Whenever a new process enters, it is inserted at the end of the ready queue. The CPU scheduler picks the first process from the ready queue and processes it until the time quantum elapsed. Then CPU switches to the next process in the queue and first process is inserted at the end of the queue if it has not been finished. If the process is finished before the time quantum, the process itself will release the CPU voluntarily and the process will be deleted from the ready queue. This pro­cess continues until all the processes are finished. When a process is finished, it is deleted from the queue. To implement the round robin algorithm, a circular queue can be used.