Operating System Concepts

Slides:



Advertisements
Similar presentations
Abhinav Kamra Computer Science, Columbia University 4.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 4: Processes Process Concept.
Advertisements

Adapted from slides ©2005 Silberschatz, Galvin, and Gagne Lecture 4: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Understand Process concept Process scheduling Creating.
Chapter 3: Processes.
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.
CMPT 300: Operating Systems I Ch 3: Processes Dr. Mohamed Hefeeda
Process Concept n An operating system executes a variety of programs: –Batch system – jobs –Time-shared systems – user programs or tasks n Textbook uses.
Chapter 3: Processes. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
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
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 and Galvin  Operating System Concepts Module 4: Processes Process Concept Process Scheduling Operation on Processes Cooperating.
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  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.
Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems.
Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server.
Chapter 3 Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Jan 19, 2005 Chapter 3: Processes Process Concept.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 4 Process Slide 1 Chapter 4 Process.
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.
Chapter 2 Processes Processes Topics Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication.
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.
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.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
Chapter 3: Process-Concept. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
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, Jan 19, 2005 Chapter 3: Processes Process Concept.
Chapter 3: Processes-Concept. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes-Concept Overview Process Scheduling.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
 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 Chapter 3: Processes Process Concept Process Scheduling Operations.
Chapter 3: Process-Concept. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 3: Process-Concept Process Concept Process Scheduling.
4.1 Operating System Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
XE33OSA Chapter 3: Processes. 3.2XE33OSASilberschatz, Galvin and Gagne ©2005 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes.
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Operating System Concepts
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Processes.
Chapter 4: Processes Process Concept Process Scheduling
Processes Overview: Process Concept Process Scheduling
Chapter 3: Process Concept
Chapter 3: Processes.
Applied Operating System Concepts
Chapter 3: Processes.
Chapter 4: Processes Process Concept Process Scheduling
Lecture 2: Processes Part 1
Recap OS manages and arbitrates resources
Process & its States Lecture 5.
Chapter 3: Processes.
Chapter 3: Processes.
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Concept
Processes August 10, 2019 OS:Processes.
Presentation transcript:

Operating System Concepts Process Concept An operating system executes a variety of programs: Batch system – jobs Time-shared systems – also called user programs or tasks Job – A program in execution. A job can contains some processes. Process – execution must progress in sequential fashion. A process includes: Text/Code section. Data section. Stack section. Operating System Concepts

Operating System Concepts Process Creation Parent process creates children processes, which, in turn create other processes, forming a tree of processes. Resource sharing Parent and children share all resources. Children share subset of parent’s resources. Parent and child share no resources. Execution Parent and children execute concurrently. Parent waits until children terminate. Address space Child duplicate of parent. Child has a program loaded into it. Operating System Concepts

A Tree of Processes On A Typical UNIX System Operating System Concepts

Operating System Concepts Process Termination Process executes last statement or asks the operating system to decide it (exit). Output data from child to parent (via exit & wait). Process’ resources are deallocated by operating system. Any process may terminate execution of another processes of the same user. (kill). When Parent is exiting. UNIX declares on its child as orphan and “init” adopts this child. There are some operating systems which do not allow child to continue if its parent terminates. They make cascading termination. Operating System Concepts

Process State (Not in Unix) As a process executes, it changes state new: The process is being created. running: Instructions are being executed. waiting: The process is waiting for some event to occur. ready: The process is waiting to be assigned to a process. terminated: The process has finished execution. Operating System Concepts

Diagram of Process State Operating System Concepts

Operating System Concepts Process State in Linux R running or ready. S sleeping (=waiting). T Stopped. Z a defunct ("zombie") process. D uninterruptible sleep (IO). Operating System Concepts

Process Control Block (PCB) Information associated with each process. Process state Process number Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O information (open files) Operating System Concepts

CPU Switch From Process to Process Operating System Concepts

Process Scheduling Queues 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. Processes migrate between the various queues. Operating System Concepts

Ready Queue And Various I/O Device Queues Operating System Concepts

Representation of Process Scheduling Operating System Concepts

Operating System Concepts Schedulers Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue. Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU. In UNIX the Long-term scheduler does not exist. Short-term scheduler is invoked very frequently (milliseconds)  (must be fast). Long-term scheduler is invoked very infrequently (seconds, minutes)  (may be slow). The long-term scheduler controls the degree of multiprogramming. Processes can be described as either: I/O-bound process – spends more time doing I/O than computations, many short CPU bursts. CPU-bound process – spends more time doing computations; few very long CPU bursts. Operating System Concepts

Operating System Concepts Context Switch When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process. Context-switch time is overhead; the system does no useful work while switching. Time dependent on hardware support. Operating System Concepts

Cooperating Processes Independent process cannot affect or be affected by the execution of another process. Cooperating process can affect or be affected by the execution of another process Advantages of process cooperation Information sharing Computation speed-up Modularity Operating System Concepts

Producer-Consumer - Shared-Memory Solution Producer process produces information that is consumed by a Consumer process. How to implement? Shared data var n; type item = … ; var buffer. array [0..n–1] of item; in, out: 0..n–1; Producer process repeat … produce an item in nextp while in+1 mod n = out do no-op; buffer [in] :=nextp; in :=in+1 mod n; until false; Operating System Concepts

Bounded-Buffer (Cont.) Consumer process repeat while in = out do no-op; nextc := buffer [out]; out := out+1 mod n; … consume the item in nextc until false; Solution is correct, but can only fill up n–1 buffer. Operating System Concepts

Operating System Concepts Direct Communication Processes must name each other explicitly: send (P, message) – send a message to process P receive(Q, message) – receive a message from process Q Properties of communication link Links are established automatically. A link is associated with exactly one pair of communicating processes. Operating System Concepts

Indirect Communication Messages received from the resource itself. Each resource has a unique id. Processes can communicate only if they share a resource. Properties of communication link Link established only if processes share a common resource. A link may be associated with many processes. Operations create a new resource. send and receive messages through resource. destroy a resource. Operating System Concepts

Operating System Concepts Synchronization Message passing may be either blocking or non-blocking. Blocking is considered synchronous Non-blocking is considered asynchronous send and receive primitives may be either blocking or non-blocking. Operating System Concepts

Operating System Concepts Buffering Queue of messages attached to the link; implemented in one of three ways. 1. Zero capacity – 0 bytes Sender must wait for receiver (rendezvous). Bounded capacity – finite length of n bytes Sender must wait if the link is full. Unbounded capacity – infinite length Sender never waits. In UNIX there are: Pipes – Bounded capacity Messages – Unbounded capacity Operating System Concepts