Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)

Slides:



Advertisements
Similar presentations
Chapter 3 Process Description and Control
Advertisements

A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
Introduction to Processes
Processes CSCI 444/544 Operating Systems Fall 2008.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
1/23/2008CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
CSSE Operating Systems
Process Concept An operating system executes a variety of programs
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
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.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Implementing Processes and Process Management Brian Bershad.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
8-Sep Operating Systems Yasir Kiani. 8-Sep Agenda for Today Review of previous lecture Process scheduling concepts Process creation and termination.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Computer Studies (AL) Operating System Process Management - Process.
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
11/13/20151 Processes ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
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.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
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.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Lecture 3 Process.
Processes and threads.
Process concept.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Sujata Ray Dey Maheshtala College Computer Science Department
Lecture Topics: 11/1 Processes Process Management
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Process Concept
Chapter 3: Processes.
Intro to Processes CSSE 332 Operating Systems
Chapter 3: Processes.
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.
Lecture 2: Processes Part 1
System Structure B. Ramamurthy.
Operating Systems Lecture 6.
Process & its States Lecture 5.
Mid Term review CSC345.
Chapter 3: Processes.
Operating System Concepts
Process Description and Control
Processes Hank Levy 1.
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 3: Processes.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Management
Presentation transcript:

Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)

© De Montfort University, 2004CSCI L32 Lecture Outline Concept of a “Process” Process Creation/Termination Process states Process Control Block (PCB) An overview of process scheduling –concepts –problems

© De Montfort University, 2004CSCI L33 Concept of a “Process” Recall –a process is an instance of a program that is being executed a program which is loaded into memory and is running A process must execute in sequential fashion –even though it may be interrupted by the operating system so that other processes may run

© De Montfort University, 2004CSCI L34 Process Creation Parent process creates child processes which, in turn, can create others to form a process ‘tree’ Options for process creation –resource sharing options parent and children share all resources children share subset of parent’s resources parent and child share no resources –execution options parent and children execute concurrently parent waits until children terminate

© De Montfort University, 2004CSCI L35 Process Termination Normal termination occurs if the process reaches its final instruction, execute exit A parent process may terminate execution of its child process (abort) –this may be because the child has exceeded a resource limit the user requests a child to terminate (because it’s stuck) the parent process is itself being terminated

© De Montfort University, 2004CSCI L36 Process States As a process executes, it changes state new the process is being created running instructions are being executed ready the process is ready to run, but is waiting for the processor to become available blocked (waiting) the process is waiting for some event to occur terminated the process has finished execution

© De Montfort University, 2004CSCI L37 Process State Diagram ready running scheduler dispatch interrupt blocked I/O or event block I/O or event completion new admitted terminated exit

© De Montfort University, 2004CSCI L38 Process Information OS must hold info. about a process so that it can change its state Typical information held –process management process state, program counter, processor registers, time process started, process id, parent id –memory management code location and size, data location and size, stack –I/O management files open and modes, I/O devices in use, current directory

© De Montfort University, 2004CSCI L39 Process Control Block (PCB) OS holds info. for each process in PCB (also referred to as, process table) –one entry per process When a process starts, OS allocates an entry in its PCB –the process runs until it is interrupted OS updates the process info. –or makes a system call (e.g. to open a file) OS performs the system call and updates the process info.

© De Montfort University, 2004CSCI L310 Process Control Block Process Number (ID) Process state Priority Program Counter Memory Pointers I/o states information Registers Accounting Information. To distinguish it from other processes Executing, running etc. Priority level Hold address of next instr. Hold base address of code or data I/O states and requests Time limits, account numbers

© De Montfort University, 2004CSCI L311 Context Switch When processor switches to another process, OS saves the state of the old process and load the saved state for the new process This is called a context switch –the time spent doing this is overhead (idle) –the system does no useful work while switching This time depends on both the OS and the hardware support

© De Montfort University, 2004CSCI L312 CPU Switch From Process to Process

© De Montfort University, 2004CSCI L313 Scheduling Concepts Suppose there are two jobs in the process table, both of which are in the ready state –which one should the operating system return to the ‘running’ state? –suppose one job requested a disk I/O operation and one process was doing a lengthy calculation using a lot of processor time, and was interrupted does that alter the choice? The operating system has to make a choice –there are different factors that affect the choice –there are different algorithms to make the selection

© De Montfort University, 2004CSCI L314 Scheduling Types There are different classes of scheduler types –long term selects which processes should be brought into the queue –short term selects which process should be executed by the processor –medium term selects which process is temporarily suspended and swapped out of main memory to reduce the number of processes occupying memory –not used in all operating systems

© De Montfort University, 2004CSCI L315 Scheduling Queues I/O waiting queue I/O ready queue CPU the short term scheduler decides which process to allocate to the CPU the long term scheduler decides which processes can join the ready queue partially executed swapped-out processes a medium term scheduler decides which processes to swap out of main queue

© De Montfort University, 2004CSCI L316 Potential Problems Imagine an operating system has a print spooler –when a process wants to print a file it enters the file name in a special spool directory –another process (the spooler demon) periodically checks to see if there are any files to be printed –the operating system maintains two variables out: holds the number of the next file to be printed in: holds the number of the next free slot Now imagine two processes trying to print a file at the same time –each needs to submit the file name to the spool queue This create a ‘RACE’ condition (more about this later)

© De Montfort University, 2004CSCI L317 Summary The process model – Process Creation/Termination –process states Process implementation –process control block An overview of process scheduling –concepts –Problems (Race condition, more in later lectures)