Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.

Slides:



Advertisements
Similar presentations
Ch4. Processes Process Concept (1) new waiting terminate readyrunning admitted interrupt exit scheduler dispatch I/O or event completion.
Advertisements

Abhinav Kamra Computer Science, Columbia University 4.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 4: Processes Process Concept.
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.
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.
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
1/30/2004CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
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.
Chap 3 Processes-Concept. Process Concept Process – a program in execution; process execution must progress in sequential fashion A process includes:
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operation on Processes.
Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Inter-process Communication Communication in Client-Server.
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, Feb 7, 2006 Process Concept Process – a program.
Operating Systems Part III: Process Management (Process States and Transitions)
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 4 Process Slide 1 Chapter 4 Process.
AE4B33OSS Chapter 3: Processes. 3.2Silberschatz, Galvin and Gagne ©2005AE4B33OSS Chapter 3: Processes Process Concept Process Scheduling Operations on.
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 (6 th edition chap 4). 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Chapter 3: Processes. 3.2CSCI 380 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication.
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.
Processes. Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
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.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
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.
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.
3.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Overview: Process Concept Process Scheduling Operations on Processes.
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. 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 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
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.
Chapter 3: Process Concept
Operating System Concepts
Processes Overview: Process Concept Process Scheduling
Chapter 3: Process Concept
Applied Operating System Concepts
Chapter 4: Processes Process Concept Process Scheduling
Lecture 2: Processes Part 1
Operating System Concepts
Processes August 10, 2019 OS:Processes.
Presentation transcript:

Processes CSCI 4534 Chapter 4

Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the computer –The program had access to all system resources Current computer systems allow multiple programs: –To be loaded into memory –To be executed “concurrently”

Introduction What do these terms mean: –program in execution? –unit of work in a time-sharing environment? Do not use either of these terms unless you can more clearly embellish and define them.

Introduction Main concerns of an operating system: –To execute user programs –To execute system programs

Process States New Ready Running Waiting Terminated

Process Control Blocks Each process is represented in the O.S. by a PCB –Process State –Program Counter –CPU Register contents –Information about: scheduling priority and queues memory limit and base registers, page tables accounting of CPU time used, time limits, acct #s I/O status of resources allocated and available

Process Scheduling Scheduling Queues –Ready Queue is a linked list A header may have pointers to head and tail PCBs are linked together as in Figure 4.4 –I/O device queues Queueing Diagrams –See Figure 4.5

Process Scheduling Schedulers –Long-term: to load into memory Determines degree of multiprogramming Mix of CPU-bound and I/O-bound processes –Short-term: allocates CPU to a process How much overhead do schedulers contribute? –Context switching

Process Scheduling Adding a medium-term scheduler –To reduce the degree of multiprogramming –To keep down contention for CPU –Remove process(es) from memory and swap them back in later

Context Switching CPU is switched to a different process –save state of current process –load saved state of another process as in Figure 4.3 this time is pure overhead; no useful work gets done speed ranges from 1 to 1000 microseconds

Context Switching Hardware support for context switching –Processors may provide multiple sets of registers; change a pointer to current set –Or register data is copied between registers and memory Threads are used to avoid performance problems of context switching

Process Creation New child processes get their own resources or they share with the parent The parent can either: –Execute concurrently with children –Wait until some or all children have terminated using wait( ) system call

Process Creation Parent processes can create child processes –Using a fork( ) system call: copy of parent –Or by specifying the new process Parent must know the child’s process id

Process Termination A process uses the exit( ) system call to ask the O.S. to terminate it Resources are deallocated: memory, files, buffers A parent can ask to have a process killed by using the abort( ) system call

Cooperating Processes Reasons for processes which can affect each other to cooperate: –to share information –to execute faster –to make more modular There must be ways then, for processes to communicate --> IPC

Cooperating Processes Producer-Consumer –Unbounded buffer No limit on buffer size Producer can always produce –Bounded buffer Consumer waits if buffer is empty Producer waits if buffer is full –See code pp

Interprocess Communication Needs two operations: –send( ) –receive( ) Needs a communication link –How are links established? –Are links associated with >2 processes? –What is capacity of link? –Unidirectional or bidirectional?

Interprocess Communication Buffering: what is the capacity of the link? –Zero: no messages waiting –Bounded: there is a queue with finite length –Unbounded: any number of messages can wait; sender is never delayed Should sent messages be acknowledged? What about lost messages?

Client-Server Communication Sockets –A pair of processes communicating over a network uses sockets –A socket consists of an IP address and a port number –Typically a server waits and listens for an incoming request at a specific port –A connection is made when the server accepts a connection request

Client-Server Communication Some ports are well-known and under 1024 –ftp (port 21) –telnet (port 23) –http (port 80) Other ports are assigned when a client process requests a connection –The host assigns it a port of a number > 1024 –The connection consists of the pair of sockets: (serverIP:port) and (hostIP:port) on the host –See Figures 4.9, 4.10, and 4.11

Client-Server Communication Remote Procedure Calls –Used for message-based communication between processes executing on separate systems –A port is a number which is used for addressing messages –Remote systems can obtain information by sending an RPC to that port number –See Figure 4.12 –RMI is the Java version of an RPC