CSC 350 - Dr. Gary Locklair Process Management Wassn4 due today.

Slides:



Advertisements
Similar presentations
Chapter 5 Deadlocks. Contents What is deadlock? What is deadlock? Characterization Characterization Resource allocation graph Resource allocation graph.
Advertisements

Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Lecture 6 :Deadlocks. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate with each other Involves.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 7 – Deadlock and Indefinite Postponement Outline 7.1 Introduction 7.2Examples of Deadlock.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Deadlock Chapter 3 R1 R2 P2P1 Allocated Requested.
Computer Systems/Operating Systems - Class 8
1 Wednesday, June 28, 2006 Command, n.: Statement presented by a human and accepted by a computer in such a manner as to make the human feel that he is.
The Banker’s Algorithm for A Single Resource
1 Lecture 8: Deadlocks Operating System Spring 2008.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Deadlock Prevention CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
OS Spring’03 Introduction Operating Systems Spring 2003.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES
Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
©Brooks/Cole, 2003 Chapter 7 Operating Systems. ©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components.
PROCESSES TANNENBAUM, SECTION 2-1 OPERATING SYSTEMS.
SWE202 Review. Processes Process State As a process executes, it changes state – new: The process is being created – running: Instructions are being.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance 3.6. Deadlock prevention.
1 Deadlocks 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order Suppose.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
1 Deadlocks Chapter 3. 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order.
Operating Systems 软件学院 高海昌 Operating Systems Gao Haichang, Software School, Xidian University 22 Contents  1. Introduction** 
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
CS6502 Operating Systems - Dr. J. Garrido Deadlock – Part 2 (Lecture 7a) CS5002 Operating Systems Dr. Jose M. Garrido.
OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.
This Time - Deadlock Definition Conditions for deadlocks
Operating Systems Lecture 4 Deadlock Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
CSC 322 Operating Systems Concepts Lecture - 28: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Operating Systems COMP 4850/CISG 5550 Deadlocks Dr. James Money.
Unit 4: Processes, Threads & Deadlocks June 2012 Kaplan University 1.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
CH 3 Deadlock When 2 (or more) processes remain blocked forever!
REAL-TIME OPERATING SYSTEMS
lecture 5: CPU Scheduling
Chapter 5 - Process Management
Operating systems Deadlocks.
Concurrency.
Deadlocks (part II) Deadlock avoidance – (not reasonable)
IS310 Hardware & Network Infrastructure Ronny L
Virtual Memory Networks and Communication Department.
Chapter 7: Deadlocks Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 7 – Deadlock and Indefinite Postponement
Deadlocks (part II) Deadlock avoidance – (not reasonable)
Process management Information maintained by OS for process management
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Processor Management Damian Gordon.
Operating Systems.
Computer system 돈벌자
Operating Systems.
PROCESS MANAGEMENT Information maintained by OS for process management
Deadlocks Definition A set of processes is in a Deadlock state when every process in the set is waiting for an event that can only be caused by another.
Operating systems Deadlocks.
Review: Readers-Writers Problem
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Chapter 7: Deadlocks.
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Introduction to Deadlocks
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Processor Management Damian Gordon.
Chapter 3: Process Management
Presentation transcript:

CSC Dr. Gary Locklair Process Management Wassn4 due today

CSC Dr. Gary Locklair PC Operating Systems

CSC Dr. Gary Locklair Processor Management I. Processor management good background in CS:AO pages 132ff

CSC Dr. Gary Locklair Processor Management I. Processor management - process is “unaware” - OS must “manage”

CSC Dr. Gary Locklair Job and Process States Hold Ready Running Waiting I/O or event completion Scheduler dispatch I/O or event wait Admitted InterruptExit Finished Handled by Process Scheduler Handled by Job Scheduler Identify cause of state change

CSC Dr. Gary Locklair Process Management II. Process management without supervision, two “bad things” are possible …

CSC Dr. Gary Locklair Process Management - deadlock

CSC Dr. Gary Locklair No, those are dread- locks Deadlock?

CSC Dr. Gary Locklair Good Bye! Bad Guy w/ Dreadlocks

CSC Dr. Gary Locklair Process Management - deadlock multiple processes blocked by competition

CSC Dr. Gary Locklair Process Management - deadlock example 2 kindergartners … one with brush, the other with the paint

CSC Dr. Gary Locklair Process Management - starvation a process is never satisfied

CSC Dr. Gary Locklair Process Management - starvation example kind kindergartner waiting for the blocks

CSC Dr. Gary Locklair Process Management How should the OS allocate resources? range of policies liberal  conservative

CSC Dr. Gary Locklair Process Management II. Process management A. Deadlock 1. Definition

CSC Dr. Gary Locklair Process Management 1. Definition two or more processes are attempting to obtain the same non- shareable resource

CSC Dr. Gary Locklair Process Management A. Deadlock usually results from liberal policies

CSC Dr. Gary Locklair Process Management

CSC Dr. Gary Locklair Process Management

CSC Dr. Gary Locklair Process Management 1. Definition a. example process A requests tape process B requests printer process B requests tape process A requests printer

CSC Dr. Gary Locklair Process Management 1. Definition b. example process A and process B both attempt to print at same time

CSC Dr. Gary Locklair Process Management A. Deadlock 2. conditions a. mutual exclusion

CSC Dr. Gary Locklair Process Management 2. conditions b. resource holding c. non-preemption d. circular wait

CSC Dr. Gary Locklair PC Operating Systems

CSC Dr. Gary Locklair Systems Assignment 3 A // OS Simulator // Program will simulate the actions of a demand paging memory manager // // Input: data file used to simulate Jobs page requests // format of each record: X Y // where Job X requests Page Y // // Output: after each request, display the current PMT, MMT, and // page replacement success rate // // Process: for each Job’s request, OS must determine if page is in RAM // if not, then a page fault occurs and page is loaded into RAM // if there is no free RAM page, then page replacement occurs // using a FIFO scheme #include #include // header for file I/O

CSC Dr. Gary Locklair Systems Assignment 3 A type? FIFO_page_replacement (args?) // function to determine which page to replace (“kick out”) of RAM when RAM // page frames are full type? Display (args?) // function to display Page Map Table, Memory Map Table, and success rate // Page Map Table format; one for each Job: // Job Page # | Page Frame # // If Page is not in RAM, Page Frame # states disc // Memory Map Table; one for system: // Frame # | Job # // If Frame is not used, Job # states free // success_rate = page_success / page_request

CSC Dr. Gary Locklair Systems Assignment 3 A int main( void ) { const maxjobs = 3, maxpages = 5, frames = 4; int jobnumber, pagenumber; ifstream inFile; // inFile is an Input file stream inFile.open("osdata.txt"); // associate data file with file stream // and open it for use inFile >> jobnumber >> pagenumber; // read Job and Page from file // if not EOF, then inFile is True

CSC Dr. Gary Locklair Systems Assignment 3 A while (inFile) { // page_request++ // IF Job X’s Page Y currently in RAM // THEN //NO PAGE FAULT //page_success++ // ELSE // PAGE FAULT //page_fault++ // IF RAM IS FULL //FIFO_page_replacement // LOAD Job’s X Page Y INTO FREE PAGE FRAME // Display inFile >> jobnumber >> pagenumber; // read Job and Page from file

CSC Dr. Gary Locklair Sassn3 working code due in 1 week if you have good pseudocode, extensions are possible …