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

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,

Operating Systems. Lecture 05

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

CHAPTER 2: PROCESS MANAGEMENT

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

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Chapter 3: Processes

Lecture 2 Process Management

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

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

CHAPTER 3 - PROCESS CONCEPT

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

Processes. Process Concept

CSC 539: Operating Systems Structure and Design. Spring 2006

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

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

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

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

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

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

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Chapter 3: Process Concept

Chapter 3: Process Concept

Processes and Threads

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

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

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

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

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

Announcements Processes: Part II. Operating Systems. Autumn CS4023

Chapter 3: Process Concept

Diagram of Process State Process Control Block (PCB)

Chapter 4: Processes. Process Concept

Killing Zombies, Working, Sleeping, and Spawning Children

Chap 4, 5: Process. Dongkun Shin, SKKU

Chapter 4: Processes

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

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Prepared by Prof. Hui Jiang Process. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

Processes and Threads

CS3733: Operating Systems

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

TDIU25: Operating Systems II. Processes, Threads and Scheduling

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

Process. Prepared by Prof. Hui Jiang Dept. of EECS, York Univ. 1. Process in Memory (I) PROCESS. Process. How OS manages CPU usage? No.

Chapter 4: Processes. Process Concept

Part Two - Process Management. Chapter 3: Processes

2/14/2012. Using a layered approach, the operating system is divided into N levels or layers. Also view as a stack of services

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

The Big Picture So Far. Chapter 4: Processes

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

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

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

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

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

Operating Systems. Figure: Process States. 1 P a g e

Chapter 4: Processes

The Big Picture So Far. Chapter 4: Processes

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

Scheduling of processes

Processes. Sanzheng Qiao. December, Department of Computing and Software

Lecture 3: Processes. CMPUT 379, Section A1, Winter 2014 January 13, 15 and 17

Processes. CSE 2431: Introduction to Operating Systems Reading: Chap. 3, [OSC]

Processes. CS3026 Operating Systems Lecture 05

Chapter 3: Processes

Processes, PCB, Context Switch

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

OPERATING SYSTEMS: Lesson 4: Process Scheduling

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

SMD149 - Operating Systems

CS 322 Operating Systems Practice Midterm Questions

CSCE 313: Intro to Computer Systems

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

Chapter 3: Processes. Operating System Concepts 9 th Edition

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

csci3411: Operating Systems

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

Chapter 3: Process Concept

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

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

EECE.4810/EECE.5730: Operating Systems Spring 2017 Homework 1 Solution Due 3:15 PM, Wednesday, 2/1/17

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

CS 31: Intro to Systems Processes. Kevin Webb Swarthmore College March 31, 2016

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

INF1060: Introduction to Operating Systems and Data Communication. Pål Halvorsen. Wednesday, September 29, 2010

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

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

Chapter 5: CPU Scheduling

Processes. Dr. Yingwu Zhu

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

Course: Operating Systems Instructor: M Umair. M Umair

Transcription:

CS341: Operating System Process Concepts Process States, PCB System call related to Process & C examples IPC & Thread in Future class Scheduling: Theoretical Analysis Lect10 : 21 th Aug 2014 Dr. A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1 2 New admitted interrupt Terminated Exit Ready Running I/O or event completion Scheduler Dispatch Waiting I/O or event wait 3 Process state Program counter, CPU registers CPU scheduling info. priorities, scheduling queue pointers Memory managementmanagement info:memoryallocated to the process Accounting info. CPU used, clock time elapsed since start, time limits I/O status info. I/O devices allocated to process, list of open files O S Process 0 Process 1 Executing Executing Save State of PCB 0 Reload State From PCB1 Save State of PCB 1 Reload State From PCB0 Executing 1

Maximize CPU use, quickly switch processes onto CPU for time sharing Process scheduler selects among available processes for next execution on CPU Maintains scheduling queues of processes 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 Processes migrate among the various queues PCB7 PCB2 PCB3 PCB14 PCB6 PCB5 Queueing diagram represents queues, resources, flows Ready Queue I/O I/O Queue Child Executes Int occurs I/O Request Time Slice Expired Fork a Child Wait for Interrupt CPU Short term scheduler (or CPU scheduler) Selects which process should be executed next and allocates CPU Short term scheduler is invoked frequently (milliseconds) (must be fast) Long term scheduler (or job scheduler) Selects which processes should be brought into the ready queue Long term scheduler is invoked 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 scheduler strives for good process mix Context switch time is overhead; the system does no useful work while switching The more complex the OS and the PCB the longer the context switch Time dependent on hardware support Some hardware provides multiple sets of registers per CPU multiple contexts loaded at once Many time Context switch code written Manually in ALP. Compiler Generated code may not be efficient 2

One should know how to create/delete process System must provide mechanisms for: process creation process termination 13 Parent process create children processes which, in turn create other processes, forming a treeof processes Generally, process identified and managed via a process identifier (pid) 16 Resource sharing options Parent and children share all resources Children share subset of parent s resources Parent and child share no resources Execution options Parent and children execute concurrently Parent waits until children terminate 17 3

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 Fork child parents Exec() Wait Exit() Resume intmain (){ pid_t pid; pid=fork(); If(pid<0){ printf( fork failed ); return 1; else if(pid==0){ execlp( /bin/ls, ls,null); else { wait(null); printf( Child complete )l return 0; Click the Cross symbol located on right side of the application window Inlinuxcommandmode mode Send termination signal to process $kill <pid> Process executes last statement and then asks the OS to delete it using the exit() system call. Returns status data from child to parent (via wait()) Process resources are deallocatedby operating system 21 Parent may terminate the execution of children processes using the abort()system call. Some reasons for doing so: Child has exceeded allocated resources Task assignedtochildisnolongerrequired is no longer required The parent is exiting and the operating systems does not allow a child to continue if its parent terminates 24 4

CPU utilization Percentage of time the CPU is not idle Throughput Completed processes per time unit Turnaround time Submission to completion Waiting time time spent on the ready queue Response time responselatency response time most important for interactive jobs (I/O bound) Predictability variance in any of these measures Minimize latency Response or job completion time Maximize throughput Maximize jobs / time. Maximize utilization: keep I/O devices busy. Recurring theme with OS scheduling Fairness: everyone makes progress, no one starves Maximize CPU utilization Throughput Minimize Turnaround time Waiting time Response time You work as a short order cook Customers come in and specify which dish they want Eachdishtakesadifferentamountoftimeto a different amount of time to prepare Your goal: minimize average time the customers wait for their food What strategy would you use? 5

Task/Process/Job used interchangbly Let all tasks in memory Let all tasks arrived at time 0 Let all tasks don t do any IPC All task are independent All tasks don t require any other resource other then CPU Let 10 independent tasks Execution time i th task is t i 1 CPU Criteria : Minimize Cmax Cmax= finishing time of last finished task Sol : Execute in any order 32 Let 10 independent tasks Execution time i th task is t i Also tiis divided in to two part D i (I/O of Device) and C i (CPU time) 1 CPU + 1 Device A process is allowed to both D or C simultaneously A process is not allowed both D or C simultaneously Order of Di an Ciof Ti is independent Criteria : Minimize Cmax Sol : Based on Policy 33 6