[Most of the details about queues are left for to read about and work out in Lab 6.] Def. As a data structure, a queue is an ordered collection of data.

Slides:



Advertisements
Similar presentations
Data Structures Through C
Advertisements

Buffers & Spoolers J L Martin Think about it… All I/O is relatively slow. For most of us, input by typing is painfully slow. From the CPUs point.
Module R2 Overview. Process queues As processes enter the system and transition from state to state, they are stored queues. There may be many different.
CS 261- Winter 2009 Dynamic Array Queue and Deque.
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.
1 Queues CPS212 Gordon College. 2 Introduction to Queues A queue is a waiting line – seen in daily life –Real world examples – toll booths, bank, food.
1 Queues and Priority Queues Chapter 8. 2 Introduction to Queues A queue is a waiting line – seen in daily life –Real world examples – toll booths, bank,
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
OUTLINE What is the Process Management? What is it covers? pprocess state pprocess table, pprocess scheduling.
Device Management.
Queues Chapter 6. Chapter 6: Queues2 Chapter Objectives To learn how to represent a waiting line (queue) and how to use the methods in the Queue interface.
Queues Chapter 8 Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Chapter 6.6, (event-driven simulation) Queues 1CSCI 3333 Data Structures.
The Stack and Queue Types Lecture 10 Hartmut Kaiser
Process Scheduling in Windows XP, Linux, and UNIX By Sarah G. Levinson CSC 4320.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 4 Processor Management
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
CHP-4 QUEUE.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
Threads Many software packages are multi-threaded Web browser: one thread display images, another thread retrieves data from the network Word processor:
Adapted from instructor resources Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Queues Chapter 6. Chapter 6: Queues Chapter Objectives To learn how to represent a waiting line (queue) and how to use the five methods in the Queue interface:
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
1 5. Queues Def. As a data structure, a queue is an ordered collection of data items with the property that items can be removed only at one end, called.
Data Structures: Advanced Damian Gordon. Advanced Data Structure We’ll look at: – Linked Lists – Trees – Stacks – Queues.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Review of Stacks and Queues Dr. Yingwu Zhu. How does a Stack Work? Last-in-First-out (LIFO) data structure Adding an item Push operation Removing an item.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Queues. Like Stacks, Queues are a special type of List for storing collections of entities. Stacks are Lists where insertions (pushes) and deletions (pops)
1 Algorithms Queues, Stacks and Records stored in Linked Lists or Arrays.
Queues Chapter 5 Queue Definition A queue is an ordered collection of data items such that: –Items can be removed only at one end (the front of the queue)
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
Give Eg:? Queues. Introduction DEFINITION: A Queue is an ordered collection of element in which insertions are made at one end and deletions are made.
Introduction Of Queue. Introduction A queue is a non-primitive linear data structure. It is an homogeneous collection of elements in which new elements.
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.
CHAPTER 5 QUEUE v2 by Queue in C++ [Non-English] It is an ordered group of homogeneous items of elements. [English] –You go to the shopping.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
1 Data Structures CSCI 132, Spring 2014 Lecture 7 Queues.
Queues 1. Introduction A sequential collection of data Changes occur at both ends, not just one Queue applications –files waiting to be printed –"jobs"
 In general, Queue is line of person waiting for their turn at some service counter like ticket window at cinema hall, at bus stand or at railway station.
© Oxford University Press All rights reserved. Data Structures Using C, 2e Reema Thareja.
Data Structures Using C, 2e
Queues.
CPU SCHEDULING.
Lecture 7 Queues Stacks Trees.
Queues.
Lesson Objectives Aims Key Words
Objectives In this lesson, you will learn to: Define stacks
Lectures Queues Chapter 8 of textbook 1. Concepts of queue
Stacks and Queues.
Algorithms and Data Structures
Queues Chapter 8 Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved
Queues.
Process management Information maintained by OS for process management
Processor Management Damian Gordon.
Operating System Concepts
Processor Fundamentals
COT 4600 Operating Systems Spring 2011
Lesson Objectives Aims Key Words
EE 472 – Embedded Systems Dr. Shwetak Patel.
CS703 – Advanced Operating Systems
Operating System Introduction.
Introduction to Data Structure
QUEUE Visit for more Learning Resources Free Powerpoint Templates.
Scheduling 21 May 2019.
Processor Management Damian Gordon.
Presentation transcript:

[Most of the details about queues are left for to read about and work out in Lab 6.] Def. As a data structure, a queue is an ordered collection of data items with the property that items can be removed only at one end, called the front of the queue, and items can be added only at the other end, called the back of the queue. Basic operations are: construct: Create an empty queue empty: Check if a queue is empty addQ: Add a value at the back of the queue front: Retrieve the value at the front of the queue removeQ: Remove the value at the front of the queue Whereas a stack is a Last-In-First-Out (LIFO) structure, a queue is a First-In-First-Out (FIFO) or First-Come-First-Served (FCFS) structure.

2. Examples: a. I/O buffers: queues, scrolls, deques  From a file: (queue)

 Interactively: (scroll — queue on one end, stack on the other

 Screen handling: (deque — double-ended queue)

b. Scheduling queues in a multi-user computer system:  Printer queue: When files are submitted to a printer, they are placed in the printer queue. The printer software executes an algorithm something like: for (;;) { while (printerQueue.empty()) sleep 1; printFile = printerQueue.removeQ(); Print(printFile); }

 Other Queues: Resident queue: On disk, waiting for memory Ready queue: In memory — has everything it needs to run, except the CPU Suspended queue: Waiting for I/O transfer or to be reassigned the CPU

c. CPU Scheduling: Probably uses a priority queue: Items with lower priority are behind all those with higher priority. (Usually a new item is inserted behind those with the same priority.)