Project: Processes and Resource Management Textbook: pages 482-491 Lubomir Bic.

Slides:



Advertisements
Similar presentations
PROCESS MANAGEMENT. Contents   Process concept   Process states   Process description.
Advertisements

Chapter 3 Process Description and Control
The OS kernel: Implementing processes and Threads Kernel Definitions and Objects Queue Structures Threads Implementing Processes and Threads Implementing.
Chapter 1.2 Operating Systems. Layered Operating System model Hardware Operating System Application.
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.
1 Created by Another Process Reason: modeling concurrent sub-tasks Fetch large amount data from network and process them Two sub-tasks: fetching  processing.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Processes CSCI 444/544 Operating Systems Fall 2008.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Chapter 11 Operating Systems
CSSE Operating Systems
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
1 Project: File System Textbook: pages Lubomir Bic.
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Introduction to Processes CS Intoduction to Operating Systems.
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,
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
REVIEW OF COMMONLY USED DATA STRUCTURES IN OS. NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem.
The Linux Operating System C. Blane Adcock Bryan Knehr Kevin Estep Jason Niesz.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
ICS 145B -- L. Bic1 Project: Processes and Resource Management Textbook: pages ICS 145B L. Bic.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 4 Process Management. What is a Process  A primary goals of a computer system is to perform work for the system’s users.  Process is a program.
CE Operating Systems Lecture 10 Processes and process management in Linux.
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
Processes Dr. Yingwu Zhu. Process Concept Process – a program in execution – What is not a process? -- program on a disk - a process is an active object,
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Operating System Concepts and Techniques Lecture 3 Process M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First ed.,
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
1 A Seven-State Process Model. 2 CPU Switch From Process to Process Silberschatz, Galvin, and Gagne  1999.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Process Control Management Prepared by: Dhason Operating Systems.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 8 Processes II Read Ch.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
CPU SCHEDULING.
Chapter 3: Processes.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Chapter 3: Process Concept
Chapter 3: Processes.
Processes A process is a running program.
Chapter 3: Processes.
Structure of Processes
Lecture 2: Processes Part 1
CS 143A Quiz 1 Solution.
Mid Term review CSC345.
Chapter 3: Processes.
Operating System Concepts
Processes in Unix and Windows
Processes – Part I.
Chapter 3: Process Management
Presentation transcript:

Project: Processes and Resource Management Textbook: pages Lubomir Bic

Operating Systems Assignment Design/implement a simplified process and resource manager Required functionalities: –process: create/destroy –resource: request/release –time-out interrupt –multi-unit resources (5.1. page 490 of textbook) –extensive error checking 2

Operating Systems Problem: we do not have the actual processes or hardware Solution: your terminal (or test files) represent –currently running process, and –the hardware causing interrupts Overall Organization 3

Operating Systems Write presentation/test shell –it reads command from terminal or test file –it invokes kernel function –it displays reply (on terminal or to output file) which process is running any errors Overall Organization your terminal/ test files repeat get f, par invoke f(par) get reply display reply Process and Resource Manager 4

Operating Systems Presentation/test shell Example: * Process Init is running... shell> cr A 1 *Process A is running shell> cr B 2 *Process B is running shell> cr C 1 *Process B is running shell> req R1,1 *Process B is blocked; Process A is running... 5

Operating Systems Process states and operations Process states: ready, running, blocked Possible Operations: –Create: (none)  ready –Destroy: running/ready/blocked  (none) –Request: running  blocked –Release: blocked  ready –Time_out: running  ready –Scheduler: ready  running/running  ready 6

Operating Systems Process Control Block (PCB) PID CPU state — not used Memory — not used Open_Files — not used Other_resources Status: Type & List Creation_tree: Parent/Children Priority: 0, 1, 2 (Init, User, System) 7

The Ready List (RL) 3-level priority list 2 = “system” 1 = “user” 0 = “init” Priorities don’t change Every process (PCB) is either on the RL on a blocked list Operating Systems 8

Create a process Create(initialization parameters){ create PCB data structure initialize PCB using parameters link PCB to creation tree insert(RL, PCB) Scheduler() } Init process is created at start-up & can create first system or user process Any new or released process is inserted at the end of the queue (RL) 9

Operating Systems Destroy a process Destroy (pid) { get pointer p to PCB using pid Kill_Tree(p) Scheduler() } Kill_Tree(p) { for all child processes q Kill_Tree(q) free resources delete PCB and update all pointers } Process can be destroyed by any of its ancestors or by itself (exit) 10

Operating Systems Representation of Resources There is a fixed set of resources Resource Control Block (RCB) –RID –Status: counter for number of free units –Waiting_List: list of blocked processes 11

Operating Systems Request resource (1-unit resources) Request(rid) { r = Get_RCB(rid); if (r->Status == 'free') { r->Status = 'allocated‘; insert(self->Other_Resources, r); } else { self->Status.Type = 'blocked'; self->Status.List = r; remove(RL, self); insert(r->Waiting_List, self); Scheduler(); } all requests are satisfied in strict FIFO order 12

Operating Systems Release resource (1-unit resources) Release(rid) { r = Get_RCB(rid); remove(self->Other_Resources, r); if (r->Waiting_List == NIL} { r->Status = 'free'; } else { remove(r->Waiting_List, q); q->Status.Type = 'ready'; q->Status.List = RL; insert(q->Other_Resources, r); insert(RL, q); Scheduler(); }} 13

Operating Systems Scheduling 3-level priority scheduler Use preemptive round-robin scheduling within level Time sharing is simulated by function call Init process serves a dual purpose: –dummy process: lowest priority/never blocked –root of process creation tree 14

Operating Systems Scheduler Called at the end of every kernel call (1) Scheduler() { (2) find highest priority process p (3) if (self->priority priority || (4) self->Status.Type != 'running' || (5) self == NIL) (5) preempt(p, self) } Condition (3): called from create or release Condition (4): called from request or time-out Condition (5): called from destroy Preemption: Change status of p to running (status of self already changed to ready/blocked) Context switch—output name of running process 15

Operating Systems Time-out Interrupts Simulate time-sharing Time_out() { find running process q; remove(RL, q); q->Status.Type = 'ready'; insert(RL, q); Scheduler();} 16

Operating Systems Presentation/Test Shell Mandatory Commands –init –cr –de –req –rel –to 17

Operating Systems Presentation/Test Shell Optional commands (examples): –list all processes and their status –list all resources and their status –provide information about a given process –provide information about a given resource 18

Operating Systems Summary of tasks Design/implement the process and resource manager –data structures and functions Design/implement a driver program (shell) –command language and interpreter Instantiate the manager to include at start-up: –A Ready List with 3 priorities –A single process, Init –4 resources labeled: R1, R2, R3, R4 (each Ri has i units)) Submit your program for testing, submit documentation for evaluation 19

Sample test 1 cr x 2 cr y 1 to cr z 2 to req R1 1 to req R1 1 de z rel R1 1 de x init x x x x z z x z x x init 20

Sample test 2 cr x 1 cr p 1 cr q 1 cr r 1 to req R2 1 to req R3 3 to req R4 3 to req R3 1 req R4 2 req R2 2 to de q to init x x x x p p q q r r x p q r x x x p x 21