Tải bản đầy đủ (.ppt) (59 trang)

Operating system internal and design principles by williams stallings chapter 3 prcess desscription and control

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (518.05 KB, 59 trang )

Process Description and Control
Chapter 3

1


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

2


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
3


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

4


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
5


Process Elements










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


Process Control Block
• Contains the process elements
• Created and manage by the operating
system
• Allows support for multiple processes

7


Process Control Block


8


Trace of Process
• Sequence of instruction that execute for
a process
• Dispatcher switches the processor from
one process to another

9


Example Execution

10


Trace of Processes

11


12


Two-State Process Model
• Process may be in one of two states
– Running
– Not-running


13


Not-Running Process in a
Queue

14


Process Creation

15


Process Termination

16


Process Termination

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

18


A Five-State Model






Running
Ready
Blocked
New
Exit

19


Five-State Process Model

20



Process States

21


Using Two Queues

22


Multiple Blocked Queues

23


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
– ReadySuspend
24


One Suspend State


25


×