Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - III Processes. Louisiana State University. Virtual Machines Processes

Similar documents
Process a program in execution; process execution must progress in sequential fashion. Operating Systems

Chapter 3: Processes. Operating System Concepts 8th Edition,

Chapter 3: Process-Concept. Operating System Concepts 8 th Edition,

Chapter 3: Processes. Chapter 3: Processes. Process in Memory. Process Concept. Process State. Diagram of Process State

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - III Processes. Louisiana State University. Processes. September 1 st, 2009

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - VII CPU Scheduling - II. Louisiana State University

Roadmap. Multilevel Queue Scheduling. Multilevel Queue. Example of Multilevel Feedback Queue. Multilevel Feedback Queue. Tevfik Ko!

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Chapter 3: Processes

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

! The Process Control Block (PCB) " is included in the context,

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Chapter 4: Processes. Process Concept

Chapter 4: Processes

Chapter 3: Processes. Operating System Concepts Essentials 8 th Edition

2. PROCESS. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

Part Two - Process Management. Chapter 3: Processes

Chapter 3: Processes. Operating System Concepts Essentials 2 nd Edition

CHAPTER 2: PROCESS MANAGEMENT

Chapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems

Chapter 3: Process Concept

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Chapter 3: Processes. Operating System Concepts 8 th Edition,

COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 3: Process. Zhi Wang Florida State University

Chapter 3: Processes

Chapter 3: Process Concept

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

Processes. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & Apps 1

What Is A Process? Process States. Process Concept. Process Control Block (PCB) Process State Transition Diagram 9/6/2013. Process Fundamentals

Processes. Operating System Concepts with Java. 4.1 Sana a University, Dr aimen

Chapter 3: Processes

Process Concept. Chapter 4: Processes. Diagram of Process State. Process State. Process Control Block (PCB) Process Control Block (PCB)

Chapter 4: Processes

Chapter 3: Process Concept

Chapter 3: Process Concept

COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process. Zhi Wang Florida State University

Chapter 4: Processes. Process Concept

Diagram of Process State Process Control Block (PCB)

Lecture 2 Process Management

Processes and Threads

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Processes. Process Concept

CSC 539: Operating Systems Structure and Design. Spring 2006

Notice: This set of slides is based on the notes by Professor Perrone of Bucknell and the textbook authors Silberschatz, Galvin, and Gagne

CPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu

Operating Systems. Lecture 05

The Big Picture So Far. Chapter 4: Processes

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - XIV Virtual Memory - I. Louisiana State University.

Killing Zombies, Working, Sleeping, and Spawning Children

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

The Big Picture So Far. Chapter 4: Processes

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

CSCE 313: Intro to Computer Systems

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

Chapter 3: Processes. Operating System Concepts 8th Edition, modified by Stewart Weiss

Chapter 3: Processes. Operating System Concepts 9 th Edition

Chapter 3: Processes. Operating System Concepts 8th Edition

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CSC Operating Systems Spring Lecture - XIV Virtual Memory - II. Tevfik Ko!ar. Louisiana State University. March 27 th, 2008.

TDIU25: Operating Systems II. Processes, Threads and Scheduling

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - X Deadlocks - II. Louisiana State University. Deadlocks

Process. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

CHAPTER 3 - PROCESS CONCEPT

Chapter 4: Processes. Process Concept. Process State

CS307 Operating Systems Processes

Processes. Process Concept. The Process. The Process (Cont.) Process Control Block (PCB) Process State

Chapter 3: Processes. Operating System Concepts 9 th Edition

Operating Systems & Concurrency: Process Concepts

Processes. Operating System Concepts 8 th Edition

Exercise (could be a quiz) Solution. Concurrent Programming. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - IV Threads

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Process. Program Vs. process. During execution, the process may be in one of the following states

Process Concepts 8/21/2014. CS341: Operating System. Scheduling: Theoretical Analysis

Announcements. Operating Systems. Autumn CS4023

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

CS Lecture 2! Processes! George Mason University! Fall 2010!

Course: Operating Systems Instructor: M Umair. M Umair

Chapter 4: Processes

Frequently asked questions from the previous class survey

Processes. Process Scheduling, Process Synchronization, and Deadlock will be discussed further in Chapters 5, 6, and 7, respectively.

Module 3: Operating-System Structures

Announcements Processes: Part II. Operating Systems. Autumn CS4023

CS370 Operating Systems

Virtual Memory - I. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - XV. University at Buffalo.

Processes & Threads. Recap of the Last Class. Microkernel System Architecture. Layered Structure

Virtual Memory - I. Roadmap. Background. Demand Paging. valid-invalid bit. Tevfik Koşar. CSE 421/521 - Operating Systems Fall 2012

Chap 4, 5: Process. Dongkun Shin, SKKU

Processes & Threads. Recap of the Last Class. Layered Structure. Virtual Machines. CS 256/456 Dept. of Computer Science, University of Rochester

Chapter 3: Process Concept

1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Operating-System Structures

CSC Operating Systems Fall Lecture - XII Deadlocks - III. Tevfik Ko!ar. Louisiana State University. October 6 th, 2009

Transcription:

CSC 4103 - Operating Systems Spring 2008 Lecture - III Processes Tevfik Ko!ar Louisiana State University January 22 nd, 2008 1 Roadmap Virtual Machines Processes Basic Concepts Context Switching Process Queues Process Scheduling Process Termination 2

Virtual Machines A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware A virtual machine provides an interface identical to the underlying bare hardware The virtual machine creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory 3 Virtual Machines (Cont.) The resources of the physical computer are shared to create the virtual machines CPU scheduling can create the appearance that users have their own processor Spooling and a file system can provide virtual card readers and virtual line printers A normal user time-sharing terminal serves as the virtual machine operator s console 4

Virtual Machines (Cont.) Non-virtual Machine Virtual Machine (a) Nonvirtual machine (b) Virtual machine 5 Virtual Machines (Cont.) The virtual-machine concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines. This isolation, however, permits no direct sharing of resources. A virtual-machine system is a perfect vehicle for operating-systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation. The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to the underlying machine 6

VMware Architecture 7 Processes 8

Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks Process a program in execution; process execution must progress in sequential fashion A process includes: program counter stack: temporary data process control block (PCB) stack data program code Process in Memory 9 Process Control Block (PCB) Information associated with each process Process state (running, waiting..) Program counter CPU registers CPU scheduling information (i.e. process priority) Memory-management information (i.e. page & segment tables) Accounting information I/O status information 10

Process State As a process executes, it changes state new: The process is being created ready: The process is waiting to be assigned to a process running: Instructions are being executed waiting: The process is waiting for some event to occur terminated: The process has finished execution 11 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 Switching time is dependent on hardware support 12

CPU Switch From Process to Process 13 Process Scheduling Queues Job queue set of all jobs 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 Processes migrate among the various queues 14

Ready Queue And Various I/O Device Queues 15 Representation of Process Scheduling 16

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 17 Schedulers (Cont.) 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!long-term schedulers need to make careful decision 18

Addition of Medium Term Scheduling In time-sharing systems: remove processes from memory temporarily to reduce degree of multiprogramming. Later, these processes are resumed! Swapping 19 Process Creation Parent process create 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 20

A tree of processes on a typical Solaris sched: root process for OS pageout: manages memory fsflush: manages file system init: root for user processes inetd: Networking dtlogin: user login screen! Unique process id s 21 Process Creation (Cont.) Address space Child duplicate of parent Child has a program loaded into it UNIX examples fork system call creates new process exec system call used after a fork to replace the process memory space with a new program 22

C Program Forking Separate Process int main() { Pid_t pid;! /* fork another process */! pid = fork();! if (pid < 0) { /* error occurred */!! fprintf(stderr, "Fork Failed");!! exit(-1);! }! else if (pid == 0) { /* child process */!! execlp("/bin/ls", "ls", NULL);! }! else { /* parent process */!! /* parent will wait for the child to complete */ 23 Process 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 Parent may terminate execution of children processes (abort) Child has exceeded allocated resources Task assigned to child is no longer required If parent is exiting Some operating system do not allow child to continue if its parent terminates All children terminated - cascading termination 24

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 Convenience 25 Summary Virtual Machines Processes Basic Concepts Context Switching Process Queues Process Scheduling Process Termination Hmm.. Next Lecture: Threads Reading Assignment: Chapter 3 from Silberschatz. HW 1 will be out next class, due 1 week 26

Acknowledgements Operating Systems Concepts book and supplementary material by A. Silberschatz, P. Galvin and G. Gagne Operating Systems: Internals and Design Principles book and supplementary material by W. Stallings Modern Operating Systems book and supplementary material by A. Tanenbaum R. Doursat and M. Yuksel from UNR 27