Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, 2005 4.1 Operating System Concepts Operating Systems Lecture 8 Processes II Read Ch.

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

Abhinav Kamra Computer Science, Columbia University 4.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 4: Processes Process Concept.
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Understand Process concept Process scheduling Creating.
Chapter 3: Processes.
Processes CSCI 444/544 Operating Systems Fall 2008.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 3: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
CMPT 300: Operating Systems I Ch 3: Processes Dr. Mohamed Hefeeda
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Operating System Concepts
Process Concept An operating system executes a variety of programs
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
1/26/2007CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
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.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operation on Processes.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
Processes: program + execution state
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 - 7 th Edition, Feb 7, 2006 Outline n Process Concept n Process.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
1 11/1/2015 Chapter 4: Processes l Process Concept l Process Scheduling l Operations on Processes l Cooperating Processes l Interprocess Communication.
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 ©2013 Operating System Concepts – 9 th Edition Chapter 3: Processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Processes. Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
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.
CS212: OPERATING SYSTEM Lecture 2: Process 1. Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
3.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Overview: Process Concept Process Scheduling Operations on Processes.
Lecture 4: Processes & Threads. Lecture 4 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents The concept of Process Process states and life-cycle.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
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 ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
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.
Chapter 3: Processes.
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Operating System Concepts
Sujata Ray Dey Maheshtala College Computer Science Department
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Process-Concept
Processes Overview: Process Concept Process Scheduling
Chapter 3: Process Concept
Chapter 3: Processes Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 3: Processes.
Chapter 3: Processes.
CGS 3763 Operating Systems Concepts Spring 2013
Chapter 4: Processes Process Concept Process Scheduling
Lecture 2: Processes Part 1
Recap OS manages and arbitrates resources
Operating Systems Lecture 6.
Process & its States Lecture 5.
Chapter 3: Processes.
Operating System Concepts
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 3: Processes.
Chapter 3: Processes Process Concept Process Scheduling
Presentation transcript:

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 8 Processes II Read Ch

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Process Scheduling Queues Recall the process migration through multiple queues: Job queue – set of all processes in the system. Ready queue – set of all processes residing in main memory, ready and waiting to execute. Device queues – set of processes waiting for an I/O device.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Ready Queue And Various I/O Device Queues

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Representation of Process Scheduling

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Schedulers Long-term scheduler (or job scheduler)  selects which processes should be brought into the ready queue.  Is necessary when there are more processes submitted than can be stored in memory.  Absent or minimal on some systems (e.g. UNIX) Short-term scheduler (or CPU scheduler)  selects which process should be executed next among processes in the ready queue.  Allocates the CPU to next process Medium-term scheduler (swapper)  Temporarily removes process from memory and stores it on disk.  Later the process can be swapped back in.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Addition of Medium Term Scheduling We will draw a new state diagram in class that includes states for processes that have been swapped out.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Questions about Swapping Why are there two suspend states instead of one? When the OS needs memory, what processes get suspended? When memory becomes available, which processes have highest priority to be placed in the ready queue?

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Frequency of Execution Short-term scheduler is invoked very frequently (milliseconds)  (must be fast) If it executes 1 time per 100 msec and takes 10 msec to execute, what percentage of CPU time is used by the scheduler? Long-term scheduler is invoked very infrequently (seconds, minutes)  (may be slow).  The long-term scheduler controls the degree of multiprogramming.  To keep the degree of multiprogramming stable, the scheduler must bring in new processes as old processes leave the system. Medium term scheduler has an intermediate frequency of execution.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts I/O bound vs. CPU bound A process may be described as I/O bound or CPU bound. I/O bound processes spend more time doing I/O than using the CPU. CPU bound processes spend more time doing computation than using I/O Process Mix:  Ideally we want a good balance between CPU bound and I/O bound processes  What happens if all processes are I/O bound?  What happens if all processes are CPU bound? Long term and medium term (swapper) schedulers can be used to maintain a good process mix.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Context Switch When CPU switches to another process, the system must:  save the state of the old process  load the saved state for the new process.  This is known as a context switch.  The context of a process is represented by the PCB. Context-switch time is overhead; the system does no useful work while switching. The speed is dependent on hardware support, and may range between 1 and 1000 microseconds on different machines. Example: The SUN UltraSPARC has multiple sets of registers. To switch contexts, it just moves a pointer to a new register set.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Process Creation Parent processes create children processes, which, in turn create other processes, forming a tree of processes. UNIX processes: In UNIX, the swapper is the ancestor of all processes. PID = 0 (process ID) The first child of the swapper is the INIT process. PID = 1 The INIT process is the parent process to all login processes.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Diagram of UNIX Process tree We will diagram this in class.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Resources and Execution Resource sharing  EITHER: parent and children share all resources.  Children share subset of parent’s resources.  OR: Parent and child share no resources.  Why is it a good idea to restrict the child to a subset of the parent's resources? Execution  EITHER: Parent and children execute concurrently.  OR: Parent waits until some or all children terminate.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts More on Child Processes Address space  EITHER: Child is a duplicate of the parent.  OR: Child has a program loaded into it. UNIX examples  fork system call creates new process (duplicate of parent).  exec system call used after a fork to replace the process’ memory space with a new program.  (we'll see how these work later).

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Process Termination Normal Termination:  Process executes last statement and asks the operating system to delete it (exit).  Output data from child to parent (via wait).  Process’ resources are deallocated by operating system.

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Other Modes of Termination Other modes of termination: Parent may terminate execution of children processes (abort).  Child has exceeded allocated resources.  Task assigned to child is no longer required.  Parent is exiting.  Operating system may not allow child to continue if its parent terminates.  Cascading termination.  In UNIX--if the parent is terminated, the child is adopted by INIT.