1 An Architectural View of an OS Inter-process communication Process Scheduling Process Control Subsystem File Subsystem Device Drivers Hardware Control.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Chapter 3 Process Description and Control
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
The Process Model.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
1 Traditional Unix Scheduling “Traditional” means –No consideration on realtime processes. –Typically 4.3BSD and SVR3 MFQ-based –Preemptive (time quantum.
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.
Introduction to Kernel
1HW1 Explain the transition “interrupted” and “event wait.” Describe how they are different. NewReadyRunningTerminated Waiting (Blocked) admitted Dispatched.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
1 Multilevel Feedback Queue Scheduling Another way to put a preference on short-lived processes –Penalize processes that have been running longer. Preemptive.
1/23/2008CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
Processes and Resources
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
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?
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Operating System 3 PROCESS DESCRIPTION AND CONTROL.
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
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.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Chapter 3 Advanced Operating System
Operating System 3 PROCESS DESCRIPTION AND CONTROL.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Mid Term review CSC345.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Threads G.Anuradha (Reference : William Stallings)
LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Process Description and control G.Anuradha (Referred from william stallings and galvin 8 th edition)
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
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.
Process Description and Control. Process A program in execution OS Reponsibilities: –Creation/Termination –Scheduling processes –Suspension/resumption.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
SLC/VER1.0/OS CONCEPTS/OCT'99 1Processes Process Concept Process Scheduling Operation On Processes Cooperating Processes Threads Interprocess Communication.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Kernel
Sujata Ray Dey Maheshtala College Computer Science Department
Process Description and Control
KERNEL ARCHITECTURE.
Process & its States Lecture 5.
Mid Term review CSC345.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Sujata Ray Dey Maheshtala College Computer Science Department
Process Description and Control
Operating System 3 PROCESS DESCRIPTION AND CONTROL
Process Description and Control
Process Description and Control
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process State Model -Compiled by Sheetal for CSIT
Presentation transcript:

1 An Architectural View of an OS Inter-process communication Process Scheduling Process Control Subsystem File Subsystem Device Drivers Hardware Control System Call Interface Hardware level Hardware Kernel level User programsLibraries User level Memory Mgt Subsystem

2 System Call System call –A set of functions/procedures to interface user-level programs and the underlying kernel –Used to create, use and delete objects in a kernel. e.g., Processes –fork(), exit(), kill(), etc. Files –create(), open(), close(), write(), read(), mkdir(), chmod(), etc. Memory space Network connections

3 Process State Transition Process Scheduler ABC ….. A BC t process A B C Program counter (hardware register) Main Memory Layout Process Scheduler 0 x a Process A Process B Process C b c

4 Main Memory Process Scheduler 0 x a Process A Process B Process C b c a+0 a+1 a+2 a+N-1 …… A program consisting of N instructions in an assembly language Running an process = Executing a program on a CPU = Executing a sequence of assembly language instructions on a CPU

5 Main Memory Process Scheduler 0 x a Process A Process B Process C b c 1a+0 2a+1 3a+2 4a+3 5a+4 6x+0 7x+1 8b+0 9b+1 10b+2 11x+0 12x+1 13c+0 14c+1 15c+2 16c+3 17c+4 18x+0 19x+1 Time out Running A I/O request Running B Process switching Time out Running C CPU TInstructions executed on a CPU x+0 x+1 a+0 a+1 … b+0 b+1 … c+0 c+1 …

6 tABC 1 – 5RunningReady 6 – 7Ready 8 – 10ReadyRunningReady 11 – 12ReadyBlockedReady 13 – 17ReadyBlockedRunning 18 – 19ReadyBlockedReady 20 – 24RunningBlockedReady 25 – 26ReadyBlockedReady 27 – 31ReadyBlockedRunning 1a+0 2a+1 3a+2 4a+3 5a+4 6x+0 7x+1 8b+0 9b+1 10b+2 11x+0 12x+1 13c+0 14c+1 15c+2 16c+3 17c+4 18x+0 19x+1 Time out Running A Process switching I/O request Running B Process switching Time out Running C Process switching

7 How to Implement Process States? NewReadyRunningTerminated Waiting (Blocked) admitted Dispatched to a CPU interrupted I/O or event wait I/O or event completion exit

8 CPU NewReadyRunningTerminated Waiting (Blocked) admitted Dispatched to a CPU interrupted I/O or event wait I/O or event completion exit Ready Queue admitted dispatched exit interrupted I/O or event wait I/O or event completion Blocked Queue

9 Memory Layout and Memory Program Counter Main Memory Layout Process Scheduler 0 x a Process A Process B Process C b c a+0 a+1 a+2 a+N-1 …… A program consisting of N instructions in an assembly language Assumption: All processes exit in the main memory. What if the total size of processes exceeds main memory’s size?

10 Process Swapping Process swapping –Moving a part or all of a process from main memory to disk. Virtual memory Who to be swapped out from main memory? –Blocked processes They cannot run until an event (I/O op) completes. Why not swap it out? Memory space is available for other processes.

11 6-State Process Behavior Model When the swap-out operation is performed, there are two choices to select a process to bring into main memory. –A new processes being admitted –A suspended process A preference should be given on a suspended one –to execute and complete a partially-executed process, rather than increasing the total memory consumption. NewReadyRunningTerminated Waiting (Blocked) admitted Dispatched to a CPU interrupted I/O or event wait I/O or event completion exit Suspended Suspended (swapped) activated

12However… All suspended processes were in the blocked state at the time of suspension. –It makes no sense to bring a blocked (and suspended) process back in main memory. It is not ready for execution. Need to know whether a suspended process is still waiting for an event or ready for execution. New states needed –2x2 combination of (blocked or not) and (suspended or not)

13 7-State Process Behavior Model Ready: The process is in main memory and available for execution. Blocked: The process is in main memory and blocked on an event. Blocked, suspended: The process is in virtual memory and blocked on an event. Ready, suspended: The process is in virtual memory but is available for execution as soon as it is loaded to main memory. Ready, Suspended ReadyRunningTerminated Blocked activated Dispatched to a CPU interrupted I/O or event wait Event completion exit Blocked, Suspended Suspended New admitted activated

14 Blocked  Blocked, suspended –When there are no ready processes. New processes can use freed memory. –When there are ready processes. Ready processes (and currently-running processes) can use more main memory. Ready, Suspended Ready Blocked activated Event completion Blocked, Suspended Suspended activated

15 Blocked, suspended  Ready, suspended –Upon an event completion. Ready, suspended  Ready –When there are no ready processes in main memory. Ready  Ready, suspended –When a currently-running process requires more memory. Ready, Suspended Ready Blocked activated Event completion Blocked, Suspended Suspended activated

16HW1 Explain the transition “interrupted” and “event wait.” Describe how they are different. NewReadyRunningTerminated Waiting (Blocked) admitted Dispatched to a CPU interrupted I/O or event wait I/O or event completion exit

17HW2 CPU Ready Queue admitted dispatched exit interrupted Event 1 wait Event 1 occurs Event 1 Blocked Queue Event 2 wait Event 2 Blocked Queue Event 3 wait Event 2 occurs Event 3 occurs This process mgt scheme assumes that each process waits for an event. A process may want to wait for multiple events at the same time. When can this make sense? Provide an example. How do you design process queues?

18HW3 Choose an OS, and describe –Where the OS places virtual memory –How to configure (change) the total size of virtual memory on the OS.

19HW4 For the 7-state process behavior model –Draw a queuing diagram.