+ All Categories
Home > Documents > Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements...

Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements...

Date post: 28-Sep-2020
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
25
1 Process Description and Control
Transcript
Page 1: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

1

Process Description and Control

Page 2: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

2

Requirements of an Operating System

•  Interleave the execution of multiple processes to maximize processor utilization while providing reasonable response time

•  Allocate resources to processes •  Support interprocess communication

and user creation of processes

Page 3: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

3

Concepts •  Computer platform consists of a collection of

hardware resources •  Computer applications are developed to

perform some task •  Inefficient for applications to be written

directly for a given hardware platform •  Operating system provides a convenient to

use, feature rich, secure, and consistent interface for applications to use

•  OS provides a uniform, abstract representation of resources that can be requested and accessed by application

Page 4: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

4

Manage Execution of Applications

•  Resources made available to multiple applications

•  Processor is switched among multiptle application

•  The processor and I/O devices can be used efficiently

Page 5: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

5

Process

•  A program in execution •  An instance of a program running on a

computer •  The entity that can be assigned to and

executed on a processor •  A unit of activity characterized by the

execution of a sequence of instructions, a current state, and an associated set of system instructions

Page 6: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

6

Process Elements

•  Identifier •  State •  Priority •  Program counter •  Memory pointers •  Context data •  I/O status information •  Accounting information

Page 7: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

7

Process Control Block

•  Contains the process elements •  Created and manage by the operating

system •  Allows support for multiple processes

Page 8: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

8

Process Control Block

Page 9: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

9

Trace of Process

•  Sequence of instruction that execute for a process

•  Dispatcher switches the processor from one process to another

Page 10: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

10

Example Execution

Page 11: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

11

Trace of Processes

Page 12: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

12

Page 13: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

13

Two-State Process Model •  Process may be in one of two states •  Put in Not running queue when created

Page 14: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

14

Process Creation

Page 15: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

15

Process Termination

Page 16: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

16

Process Termination

Page 17: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

17

Processes

•  Not-running –  ready to execute

•  Blocked – waiting for I/O

•  Dispatcher cannot just select the process that has been in the queue the longest because it may be blocked

Page 18: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

18

A Five-State Model

•  New •  Ready •  Running •  Blocked •  Exit

Page 19: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

19

Five-State Process Model

Page 20: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

20

Using Two Queues

Page 21: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

21

Multiple Blocked Queues

Page 22: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

22

Suspended Processes

•  Processor is faster than I/O so all processes could be waiting for I/O

•  Swap these processes to disk to free up more memory

•  Blocked state becomes suspend state when swapped to disk

•  Two new states – Blocked/Suspend – Ready/Suspend

Page 23: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

23

Reasons for Process Suspension

Page 24: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

24

One Suspend State

Page 25: Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements of an Operating System • Interleave the execution of multiple processes to maximize

25

Two Suspend States


Recommended