Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements...
Transcript of Process Description and Control - uniroma1.it · Process Description and Control . 2 Requirements...
![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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/6.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/14.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/15.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/16.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/17.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/18.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/19.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/20.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/21.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/22.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/23.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/24.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051511/601719b4ed8cce647e7cea88/html5/thumbnails/25.jpg)
25
Two Suspend States