CS153: Process. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Similar documents
CS153: Memory Management 1

CS153: Process 2. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

CS153: Deadlock. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

CS153: Communication. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

CSE 153 Design of Operating Systems

Announcements Processes: Part II. Operating Systems. Autumn CS4023

Processes. Process Concept

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

Processes & Threads. Process Management. Managing Concurrency in Computer Systems. The Process. What s in a Process?

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Processes (Intro) Yannis Smaragdakis, U. Athens

Processes. Dr. Yingwu Zhu

CS153: Final Review1. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

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

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

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

Processes. Operating System Concepts 8 th Edition

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

Chap 4, 5: Process. Dongkun Shin, SKKU

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Process Description and Control

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

CSE 153 Design of Operating Systems Fall 2018

Processes and Threads

Killing Zombies, Working, Sleeping, and Spawning Children

CS 153 Design of Operating Systems Spring 18

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

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

CS 537 Lecture 2 - Processes

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

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

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

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1

Chapter 3: Process Concept

Chapter 3: Process Concept

CS 153 Design of Operating Systems Fall 18

OS lpr. www. nfsd gcc emacs ls 9/18/11. Process Management. CS 537 Lecture 4: Processes. The Process. Why Processes? Simplicity + Speed

CSC369 Lecture 2. Larry Zhang

CHAPTER 3 - PROCESS CONCEPT

Chapter 3: Processes

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

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

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

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

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

Chapter 3: Processes

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

Processes & Threads. Today. Next Time. ! Process concept! Process model! Implementing processes! Multiprocessing once again. ! More of the same J

Scheduler Activations. Including some slides modified from Raymond Namyst, U. Bordeaux

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

CHAPTER 2: PROCESS MANAGEMENT

Process. Discussion session 3 1/30/2016

4. The Abstraction: The Process

Slide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.

CSC369 Lecture 2. Larry Zhang, September 21, 2015

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

Chapter 3: Processes

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed

Process Description and Control. Chapter 3

COMP 3430 Robert Guderian

Learning Outcomes. Processes and Threads. Major Requirements of an Operating System. Processes and Threads

Chapter 3: Processes. Operating System Concepts 9 th Edition

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

Background: Operating Systems

Process Description and Control

Computer. Operating Systems Introduction to Operating System (OS)

CS 318 Principles of Operating Systems

Processes and Threads

CS 326: Operating Systems. Process Execution. Lecture 5

CSE 451: Operating Systems Winter Module 4 Processes. Mark Zbikowski Allen Center 476

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Process Description and Control

Lecture 4: Threads; weaving control flow

Process Concept. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

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

Lecture 4: Process Management

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

Advanced Operating Systems (CS 202)

Threads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018

Class average is Undergraduates are performing better. Working with low-level microcontroller timers

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

EEE3052: Introduction to Operating Systems. Fall Project #1

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

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

1/13/2019 Operating Systems. file:///volumes/users/rasit/desktop/comp3430/coursematerial/slides/03_processes/index.html?

Announcement. Exercise #2 will be out today. Due date is next Monday

Processes and Threads

Computer Systems II. First Two Major Computer System Evolution Steps

csci3411: Operating Systems

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Lecture 2 Process Management

CSC 539: Operating Systems Structure and Design. Spring 2006

Fall 2017 :: CSE 306. Process Abstraction. Nima Honarmand

CSCC69H3. Operating Systems Sina Meraji U of T

Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

Lecture Topics. Announcements. Today: Threads (Stallings, chapter , 4.6) Next: Concurrency (Stallings, chapter , 5.

PROCESSES. Jo, Heeseung

Transcription:

1 CS153: Process Chengyu Song Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

2 Administrivia Lab New TA Bojian Du Group info in process, will help the rest form groups Ask questions, piazza is preferred as other students may have the same one Lab1 will be released on this Friday (4/14) Survey Lab session time

3 OS abstractions Three major types of resources +-----------+----------------+-------------+ Process Virtual Memory File System +-----------+----------------+-------------+ Operating System +-----------+----------------+-------------+ Processor Memory Disk +-----------+----------------+-------------+

4 Class segments 1. Process, scheduling, and concurrency Basis for lab1 and midterm 2. Memory management 3. Persistence 4. Communication and security

5 What is a process (user perspective) Process is a program in execution Programs are static entities with the potential for execution Process is an active instance of a program Dynamic states: context, memory A program can have multiple instances A process is sometimes called a "job" or a "task"

6 What is a process (OS perspective) Process is the OS abstraction for execution A proxy of user OS interacts directly with processes Inherits user's privileges The only subject abstraction All other resources are abstracted as objects But a process itself is also an object The entity of resources allocation

7 Process components An address space and an ID (PID) Static Code and initial data (i.e., the program image) Dynamic Virtual memory allocated to the process: stack, heap, etc. Processor states: program counter (PC), general-purpose registers A set of operating system resources: opened files, network connections, etc.

Address space 8

9 Process states A process has an execution state that indicates what it is currently doing Running : executing instructions on the CPU It is the process that is currently using the CPU How many processes can be in the running state simultaneously? Ready : waiting to be assigned to the CPU Ready to execute, but another process is executing on the CPU Waiting : waiting for an event, e.g., I/O completion It cannot make progress until event is signaled (disk completes)

Process states graph 10

11 Process Data Structures Q: how does the OS represent a process in the kernel? At any time, there are many processes in the system, each in its particular state The OS data structure representing each process is called the Process Control Block (PCB) PCB contains all of the info about a process

12 PCB PCB where OS keeps all of a process' related information Process ID (PID) Execution state Hardware state: PC, SP, regs Memory management Scheduling info: priority, statistics Security context etc

Xv6 struct proc 13

14 PCB in common OS Windows: EPROCESS Linux: task_struct (~500 LoC) macos, *BSD, Solaris: proc NOTE: real PCBs can be split into multiple data structures

15 PCBs and hardware state Hardware state is everything that is needed to restore the hardware to the same configuration it was in when the process was switched out of the hardware The magician When the OS stops running a process, it saves the current hardware state to the PCB When the OS restarts the executing a process, it loads the previous hardware state from the PCB

16 Context switch The procedure of changing the hardware state from one process to another is called a context switch States changes between privilege levels are also referred as context switch User -> kernel (syscall)

17 State queues Q: how does the OS keep track of processes? The OS maintains a collection of queues that represent the state of all processes in the system Typically, the OS has one queue for each state Running, ready, waiting, etc. Each PCB is queued on a state queue according to its current state As a process changes state, its PCB is unlinked from one queue and linked into another

State queues (cont.) 18

19 PCBs and state queues PCBs are data structures dynamically allocated in OS memory When a process is created, the OS allocates a PCB for it, initializes it, and places it on the Ready queue As the process computes, does I/O, etc., its PCB moves from one queue to another When the process terminates, its PCB is deallocated

20 Preview: process creation Creates and initializes a new PCB Creates and initializes a new address space Loads the program into the address space Initializes the address space and hardware state Initializes other OS resources Places the PCB on the ready queue

21 Summary What is a process? An execution of a program, an abstraction of execution What are the components of a process? PID, address space, static states, dynamic states What are the states of a process? Running, ready, wait, etc. How does of manages process Process control blocks (PCB), queues

22 For next class... Processes creation and scheduling Continue to get familiar with the lab environment Textbook Module 3, 4, 5, 6