Process Scheduling. Process The activation of a program. Can have multiple processes of a program Entities associated with a process –Instruction pointer,

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

Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
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.
Processes CSCI 444/544 Operating Systems Fall 2008.
Concurrency. What is Concurrency Ability to execute two operations at the same time Physical concurrency –multiple processors on the same machine –distributing.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
CSE451 Processes Spring 2001 Gary Kimura Lecture #4 April 2, 2001.
Processes April 5, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Process Concept An operating system executes a variety of programs
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
UNIX System Administration Handbook Chapter 4. Controlling Processes 3 rd Edition Evi Nemeth et al. Li Song CMSC691X Summer 2002.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
1 From Processes to Threads. 2 Processes, Threads and Processors Hardware can interpret N instruction streams at once  Uniprocessor, N==1  Dual-core,
Operating Systems Lecture 09: Threads (Chapter 4)
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Implementing Processes and Process Management Brian Bershad.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Operating Systems 1 K. Salah Module 2.0: Processes Process Concept Trace of Processes Process Context Context Switching Threads –ULT –KLT.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
E X C E E D I N G E X P E C T A T I O N S OP SYS Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Functions of an operating.
Lecture – Performance Performance management on UNIX.
OS, , Part II Processes Department of Computer Engineering, PSUWannarat Suntiamorntut.
Threads G.Anuradha (Reference : William Stallings)
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
11/13/20151 Processes ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
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.
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.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Processes & Threads Introduction to Operating Systems: Module 5.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
1 OS Review Processes and Threads Chi Zhang
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Process Control Management Prepared by: Dhason Operating Systems.
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.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Processes and threads.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
CS 6560: Operating Systems Design
Copyright ©: Nahrstedt, Angrave, Abdelzaher
OPERATING SYSTEMS CS3502 Fall 2017
Lecture Topics: 11/1 Processes Process Management
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Processes.
Processes A process is a running program.
CS 143A Quiz 1 Solution.
Process & its States Lecture 5.
PROCESS MANAGEMENT Information maintained by OS for process management
Processes Hank Levy 1.
Processes and Process Management
Chapter 3: Processes.
Processes – Part I.
CS510 Operating System Foundations
CSE 153 Design of Operating Systems Winter 2019
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Management
Presentation transcript:

Process Scheduling

Process The activation of a program. Can have multiple processes of a program Entities associated with a process –Instruction pointer, SP, other registers –user who owns it –memory location of user data areas –own run-time stack –instructions Different for each process

Processes Running Solaris (sun) -> ps -Af linux -> ps –aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root ? S Sep21 0:07 init root ? SW Sep21 0:00 [keventd] root ? SW Sep21 0:05 [kapmd] root ? SWN Sep21 0:14 [ksoftirqd_CPU0] root ? SW Sep21 1:06 [kswapd] root ? SW Sep21 0:00 [bdflush] root ? SW Sep21 0:40 [kupdated] root ? SW< Sep21 0:00 [mdrecoveryd] root ? SW Sep21 3:02 [kjournald] root ? S Sep21 0:00 devfsd /dev root ? SW Sep21 0:00 [khubd] root ? SW Sep21 0:23 [kjournald] root ? SW Sep21 1:22 [kjournald] root ? SW Sep21 5:03 [kjournald] root ? S Sep21 0:08 httpd-perl -f /et apache ? S Sep21 0:00 httpd-perl -f /et apache ? S Sep21 0:00 httpd-perl -f /et apache ? S Sep21 0:00 httpd-perl -f /et

Process Scheduling Order of process execution is unpredictable Duration of execution is unpredictable OS and/or hardware can support concurrency Whether there is an appearance or real concurrency is not relevant to the designer. There will generally be a need to resynchronize activity between cooperating processes

Context switch When OS switches running process, it manipulates internal process tables Loading/storing registers must be done Thread s minimize that effort. Same process, but a different run-time stack. A process within a process. Necessary overhead to manage processes but must balance overhead with advantage of concurrency (real or apparent)

What causes context switch? Process runs out of share of CPU time Process blocks –Doing I/O –Waiting on another process to communicate Process terminates

Blocking A process needs to do I/O, transfer disk to memory. Another process can use CPU Conflict ->Bus Running process gets the priority Blocked processes use the cpu when free CPU Memory Disk

Operating Systems Scheduling Ready Running 200 Blocked blocks when reading from the disk Ready Running 205 Blocked Ready Running 205 Blocked unblocks when done, ->ready

What other activities are important in scheduling? Jobs go from RUNNING to READY when they lose their time slot Jobs go from blocked to READY when the I/O operation they are waiting for completes Jobs go from RUNNING to being removed completely upon exit

How does this create concurrency? I/O usage and CPU usage Execute concurrently –CPU is adding –Disk is moving heads and buffering data for transfer across the bus. One of the main efforts of the OS is to manage this concurrency –In addition to lots of others: security, fairness,etc

How do you get limited parallelism from the OS? time Process A runs onCPU; blocks on read Disk reads for B while blocked Disk reads for A while A blocked Process C runs for it’s time slice Process B runs cpu disk controller There are times when both processors (CPU and controller) are busy so real parallelism does occur but not at the level of the CPU

Concurrency at many levels Process level.. –Scheduling the overlap of CPU and I/O –CAN use concurrency if multiple CPUs AND OS supports Subprocess level (like a procedure)..thread –Mini-context switch same main process Different subprocess Statement level –Typically requires special hardware (arrays of cpus)