Intro to Processes CSSE 332 Operating Systems

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

Processes Management.
Chapter 3 Process Description and Control
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
CSSE Operating Systems
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
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.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Computer Studies (AL) Operating System Process Management - Process.
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.
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: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
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.
14/06/ :48:20 CSC Alliance — 1 Kimera Richard Phone: INSTITUTE OF COMPUTER SCIENCE DEPARTMENT.
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.
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
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.
Lecture 3 Process.
Processes and threads.
Process concept.
Operating Systems CMPSC 473
Chapter 3: Processes.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
CS 6560: Operating Systems Design
Operating System Concepts
Operating Systems (CS 340 D)
Sujata Ray Dey Maheshtala College Computer Science Department
OPERATING SYSTEMS CS3502 Fall 2017
Lecture Topics: 11/1 Processes Process Management
Process Management Presented By Aditya Gupta Assistant Professor
Processes Overview: Process Concept Process Scheduling
Chapter 3: Process Concept
Chapter 3: Processes Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 3: Processes.
Operating Systems (CS 340 D)
Chapter 3: Processes.
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
Lecture 2: Processes Part 1
Recap OS manages and arbitrates resources
Process & its States Lecture 5.
Chapter 3: Processes.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Processes Hank Levy 1.
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 3: Processes.
Processes – Part I.
Process.
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Concept
Presentation transcript:

Intro to Processes CSSE 332 Operating Systems Rose-Hulman Institute of Technology Collect quiz on Pointers. 1

Announcements Projects in Lab 1 are due tomorrow at 11:59 PM Run svn st at a terminal to check the status of your repo. 2

Processes A process is a program in execution A process requires resources, which are managed by the operating system The OS interleaves the execution of several processes to maximize processor utilization OS supports Inter-Process Communication (IPC) and user creation of processes Process requires hardware resources (CPU, memory, HDD, devices) The CPU is multiplexed among OS processes and user processes 3

Process in memory max Stack Heap Data Text Q3 This figure represents the structure of a process in memory. Recall that a process is more than the program code. Program code is just the text section (stores list of instructions on disk in a file called an executable file) of a process. It is a passive entity. A process is an active entity with a program counter that holds address on next instruction and a set of associated resources. DATA Section: stores global variables How does the stack differ from the heap? STACK: contains temporary data (function parameters, local variables, return addresses) HEAP: Memory that is dynamically allocated Text Q3 4

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 processor. Running: Instructions are being executed. Waiting or blocked: The process is waiting for some event to occur. Terminate or Exit: The process has finished execution. As a process executes, it changes state. The state of a process is defined partly by the current activity of the process Each process may be in one of the following states: 5

Diagram of process state The scheduler that dispatches processes is called the CPU scheduler, short term scheduler, dispatcher. It runs on the order of milliseconds (e.g., every 100 milliseconds). From which state must a process be before it can be dispatched? Exactly how many processes can execute on each CPU? 6

Process representation in OS Each process is represented as a process control block PCB or task control block PCB contains many pieces of information associated with a specific process Process state Program counter CPU registers CPU scheduling information Memory management information I/O status information Accounting information Process state (new, ready, running, waiting, etc.) Registers include accumulators, index registers, stack pointers, general-purpose registers, etc. These vary in number and type based on the computer architecture. Scheduling info includes process priorities, pointers to scheduling queues, and so on. Memory management info depends on memory management system being used. I/O status info includes list of I/O devices allocated to the process, list of open files, and so on. Accounting (amount of CPU and real-time used; time limits, account numbers, process numbers, etc.) 7

Process Control Block 8

Support for multiple threads In single threaded model, only one thread of execution Only one thing can be done at a time In word processor, cannot type and spell check at the same time Many modern OS’s expanded process concept to support multiple threads Multiple tasks can be performed at once PCB is expanded to include info for each thread

Process scheduling Objective of multiprogramming: Have some process running at all time Keep CPU(s) busy Objective of time sharing: Switch CPU(s) among processes frequently Allow user to interact with each running process To meet these objectives process scheduler selects an available process for execution on the CPU Only one process can run on a CPU at a time. 10

CPU Process Switch CPU receives an interrupt or P0 issues a system call. OS needs to respond to and handle the interrupt or execute a system call on behalf of P0. The machine must first save the state of P0 before the kernel does so. 1. The machine then transfers control to the kernel. Set kernel mode and set PC := handler. 2. Kernel handler examines registers and saved machine state. What happened? What was the machine doing when it happened? How should the kernel respond? 3. Kernel responds to the condition. Execute kernel service, device control code, fault handlers, etc., modify machine state as needed. 4. Kernel restores saved context (registers) and resumes activity or in this case switches to process P1 to allow it to execute. 5. Specific events and mechanisms for saving, examining, or restoring context are machine-dependent. 11

Process Scheduling Queues 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. Process migration between the various queues. As processes enter the system they are put into a job queue, which consists of all the processes in the system. Processes that are resident in memory and ready and waiting to execute are kept on a list called the ready queue. There are several other queues that processes can be on. What really is put on the queue? The PCBs (or pointers to the PCBs) 12

Ready Queue, I/O Device Queues Each device has its own device queue. Queues are represented as lined lists. 13

Process Scheduling diagram A common representation of process scheduling is a queuing diagram. Each rectangular box represents a queue. The circles represent the resources that serve the queues. The arrows represent the flow of processes in the system. 14

Schedulers Long term scheduler: job scheduler Medium term scheduler: selects which processes should be brought into the ready queue. invoked infrequently (seconds, minutes) controls the degree of multiprogramming Medium term scheduler: allocates memory for process. invoked periodically or as needed. Short term scheduler: selects which process should be executed next and allocates CPU. invoked frequently (ms) A process migrates among the various scheduling queues throughout its lifetime. The OS must select, for scheduling purposes, processes from among these queues in some fashion. The selection process is carried out by the appropriate scheduler. If the short term scheduler executes at least once every 100 ms and takes about 10 ms to execute, what percent of the CPU time is used simply to schedule work? 10/(100 + 10) ~ 9%. 15

Next class Finish up scheduling Operating on processes Inter process communication. 16