PROCESSES TANNENBAUM, SECTION 2-1 OPERATING SYSTEMS.

Slides:



Advertisements
Similar presentations
Chapter 3 Process Description and Control
Advertisements

A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
Processes and Resources
CSSE Operating Systems
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
Processes April 5, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
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)
Process Description and Control A process is sometimes called a task, it is a program in execution.
Process Description and Control
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
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.
Introduction to Processes CS Intoduction to Operating Systems.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Exec Function calls Used to begin a processes execution. Accomplished by overwriting process imaged of caller with that of called. Several flavors, use.
Chapter 3 Process Description and Control
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.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Processes: program + execution state
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Assistant Professor, University of Maryland Baltimore County.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
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.
OS, , Part II Processes Department of Computer Engineering, PSUWannarat Suntiamorntut.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Computer Studies (AL) Operating System Process Management - Process.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
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.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Processes 2 Introduction to Operating Systems: Module 4.
Direct memory access. IO Command includes: buffer address buffer length read or write dada position in disk When IO complete, DMA sends an interrupt request.
Process Control Management Prepared by: Dhason Operating Systems.
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.
Processes and threads.
Process concept.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Lecture Topics: 11/1 Processes Process Management
Chapter 3: Processes.
Processes A process is a running program.
System Structure and Process Model
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
System Structure and Process Model
Structure of Processes
System Structure B. Ramamurthy.
Processor Management Damian Gordon.
System Structure and Process Model
Module 2.1 COP4600 – Operating Systems Richard Newman
Process & its States Lecture 5.
Process Description and Control
Processes Hank Levy 1.
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Chapter 3: Processes.
Processes David Ferry CSCI 3500 – Operating Systems
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
CS510 Operating System Foundations
CSE 451: Operating Systems Autumn 2004 Module 4 Processes
Processes Hank Levy 1.
Process Description and Control in Unix
Processor Management Damian Gordon.
Presentation transcript:

PROCESSES TANNENBAUM, SECTION 2-1 OPERATING SYSTEMS

DEFINITION: PROCESS Program in execution Current value of program counter Values of registers Values of variables

THE PROCESS MODEL (1) Four Independently Scheduled Processes

THE PROCESS MODEL (2) Only one program is active at once.

STATES Processes go through a series of discrete states Running State Process currently has cpu Ready state Could use cpu if one were available Blocked state Waiting for some event to happen, say i/o completion

LISTS Assume a single CPU system 1 process can run at a time Several process may be ready Several processes may be blocked Two Lists Priority queue of ready processes Unordered list of blocked processes Unordered because processes become unblocked in the order in which the resources they require become available.

EXAMPLE Process A pty 1 waiting for keyboard input Process B pty 2 waiting for printer Process C pty 3 waiting for disk input Where 3 is highest If Process A gets input before C gets input, we shouldn’t hold process A

STATES (2) Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

READY TO RUNNING Job is admitted to system Process created and placed in ready queue Gradually makes its way to the head of the queue When CPU is available, scheduled (dispatched)

RUNNING TO READY Process exhausts quantum Clock generates an interrupt o/s dispatches highest priority ready process

RUNNING TO BLOCKED Running process does i/o op Blocks itself

BLOCKED TO READY Event for which process was waiting completes Process is added to priority queue

PROCESS TABLE Every O/S has a process table 1 entry per process, called the PCB PCB is a record (struct) Process table is an array of pointers to structs Each process is uniquely identified by its PCB

PROCESS CONTROL BLOCK PCB is what defines a process to the system Current state of the process (running, ready, blocked) Unique id of the process Pointer to the process’ parent Pointer to each child process Process’ priority Pointer to process’ memory Pointer to allocated resources (printers, disk drives, unacknowledged messages) Register save area File descriptors Processor that process is running on

EXAMPLE: FORK int fork() Returns -1: no process was created 0: returned to the child process pid: returned to parent process Creates Copy of parent process but with its own pid and a different parent pid

EXAMPLE: WAIT int* status int wait(status) Suspends calling process until it receives a signal to wakeup Returns (in the case of a fork) pid of child -1 if childless See example 10 on the website

MODELING MULTIPROGRAMMING Suppose a process spends a fraction, p, of its time waiting for i/o. That is, at any randomly chosen time, the probability that the process is blocked waiting for i/o is p. With n processes, the probability that all are waiting for i/o = p n So, the probability that the cpu is used = 1 – p n

MODELING MULTIPROGRAMMING (2) CPU use as a function of the number of processes in memory (i.e., n). As prob. of i/o blocking increases, cpu use increases with more processes. Of course, the more memory, the more processes.