




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Process
Description
and
ControlChapter
312Requirements
concerned
withProcesses
in
an
Operating
System
Interleave
the
execution
of
multipleprocesses
to
maximize
processorutilization
while
providing
reasonableresponse
timeAllocate
resources
to
processes
Support
interprocess
communication
anduser
creation
of
processes3Concepts
Computer
platform
consists
of
a
collectionhardware
resources
Computer
applications
are
developed
toperform
some
task
Inefficient
for
applications
to
be
writtendirectly
for
a
given
hardware
platform
Operating
system
provides
a
convenient
touse,
feature
rich,
secure,
and
consistentinterface
for
applications
to
use
OS
provides
a
uniform,
abstract
representatof
resources
that
can
be
requested
andaccessed
by
application4Manage
Execution
ofApplications
Resources
are
made
available
to
multiapplications
Processor
is
switched
among
multiptlapplication
The
processor
and
I/O
devices
can
beused
efficiently5ProcessA
program
in
execution
An
instance
of
a
program
running
on
acomputer
The
entity
that
can
be
assigned
to
andexecuted
on
a
processor
A
unit
of
activity
characterized
by
t
execution
of
a
sequence
of
instructio
a
current
state,
and
an
associated
set
system
instructions6Process
ElementsIdentifierStatePriorityProgram
counterMemory
pointersContext
dataI/O
status
informationAccounting
information7Process
Control
BlockContains
the
process
elements
Created
and
manage
by
the
operatingsystemAllows
support
for
multiple
processeProcess
Control
Block89Trace
of
Process
Sequence
of
instruction
that
executea
processDispatcherA
program
that
moves
the
processor
from
one
process
to
anotherswitches
the
processor
from
one
processanother
to
prevent
a
single
process
frommonopolizing
the
processor
timeTrace
of
Processes1011Example
Execution12Two-State
Process
ModelProcess
may
be
in
one
of
two
statesRunningNot-running13Not-Running
Process
in
aQueue14Process
Creation15Process
Termination16Process
Termination1718ProcessesNot-runningready
to
executeBlockedwaiting
for
I/O
Dispatcher
cannot
just
select
the
prothat
has
been
in
the
queue
the
longestbecause
it
may
be
blocked19A
Five-State
ModelRunningReadyBlockedNewExitFive-State
Process
Model20Process
States21Using
Two
Queues22Multiple
Blocked
Queues2324Suspended
Processes
Processor
is
faster
than
I/O
so
allprocesses
could
be
waiting
for
I/O
Swap
these
processes
to
disk
to
free
umore
memory
Blocked
state
becomes
suspend
statewhen
swapped
to
diskTwo
new
statesBlocked/SuspendReady/SuspendReasons
for
ProcessSuspension25One
Suspend
State26Two
Suspend
States27Processes
and
Resources2829Operating
System
ControlStructures
Information
about
the
current
statuseach
process
and
resource
Tables
are
constructed
for
each
entitoperating
system
managesmemory
tablesI/O
tablesfile
tablesprocess
tables3031Memory
TablesAllocation
of
main
memory
to
processe
Allocation
of
secondary
memory
toprocesses
Protection
attributes
for
access
to
smemory
regions
Information
needed
to
manage
virtualmemory32I/O
TablesI/O
device
is
available
or
assignedStatus
of
I/O
operation
Location
in
main
memory
being
used
asthe
source
or
destination
of
the
I/Otransfer33File
TablesExistence
of
filesLocation
on
secondary
memoryCurrent
StatusAttributes
Sometimes
this
information
ismaintained
by
a
file
management
syste34Process
TableWhere
process
is
locatedAttributes
in
the
process
control
bloProgramDataStackProcess
Image353637Process
Control
BlockProcess
identificationProcessor
State
InformationProcess
Control
Information38Process
Control
BlockProcess
identificationNumeric
identifiers
that
may
be
stored
withthe
process
control
block
includeIdentifier
of
this
processIdentifier
of
the
process
that
created
this
pr(parent
process)User
identifierOthers39Processor
State
InformationUser-visible
registersControl
and
status
registersStack
pointersProcess
Control
Block40Process
Control
BlockProcessor
State
InformationUser-Visible
RegistersA
user-visible
register
is
one
that
mayreferenced
by
means
of
the
machine
language
ththe
processor
executes
while
in
user
mode.Typically,
there
are
from
8to32
of
these
regialthough
some
RISC
implementations
have
over100.41Process
Control
BlockProcessor
State
InformationControl
and
Status
RegistersThese
are
a
variety
of
processor
registers
that
aemployed
to
control
the
operation
of
the
processor.
ThesincludeProgram
counter:
Contains
the
address
of
the
nextinstruction
to
be
fetched•Program
status
word
(PSW)Condition
codes:
Result
of
the
most
recent
arithmeticlogical
operation
(e.g.,
sign,
zero,
carry,
equal,
oveStatus
information:
Includes
interrupt
enabled/disaflags,
execution
modeExample:
the
EFLAGS
register
on
Pentium
machinesPentium
II
EFLAGS
Register424344Process
Control
BlockProcessor
State
InformationStack
PointersEach
process
has
one
or
more
last-in-firout
(LIFO)
system
stacks
associated
with
it.
Astack
is
used
to
store
parameters
and
callingaddresses
for
procedure
and
system
calls.
Thestack
pointer
points
to
the
top
of
the
stack.Process
Control
BlockProcess
Control
InformationScheduling
and
State
InformationThis
is
information
that
is
needed
by
the
operatingsystem
to
perform
its
scheduling
function.
Typical
items
oinformation:Process
state:
defines
the
readiness
of
the
processbe
scheduled
for
execution
(e.g.,
running,
ready,
waitinghalted).Priority:
One
or
more
fields
may
be
used
to
describethe
scheduling
priority
of
the
process.
In
some
systems,several
values
are
required
(e.g.,
default,
current,
highallowable)Scheduling-related
information:
This
will
dependthe
scheduling
algorithm
used.
Examples
are
the
amount
oftime
that
the
process
has
been
waiting
and
the
amount
oftime
that
the
process
executed
the
last
time
it
was
runningEvent:
Identity
of
event
the
process
is
awaitingbefore
it
can
be
resumed4546Process
Control
BlockProcess
Control
InformationData
StructuringA
process
may
be
linked
to
other
processa
queue,
ring,
or
some
other
structure.
Forexample,
all
processes
in
a
waiting
state
for
aparticular
priority
level
may
be
linked
in
a
quA
process
may
exhibit
a
parent-child
(creator-created)
relationship
with
another
process.
Tprocess
control
block
may
contain
pointers
toother
processes
to
support
these
structures.47Process
Control
BlockProcess
Control
InformationInterprocess
CommunicationVarious
flags,
signals,
and
messages
may
beassociated
with
communication
between
two
independentprocesses.
Some
or
all
of
this
information
may
bemaintained
in
the
process
control
block.Process
PrivilegesProcesses
are
granted
privileges
in
terms
of
thememory
that
may
be
accessed
and
the
types
of
instructionsthat
may
be
executed.
In
addition,
privileges
may
apply
tthe
use
of
system
utilities
and
services.48Process
Control
BlockProcess
Control
InformationMemory
ManagementThis
section
may
include
pointers
tosegment
and/or
page
tables
that
describe
thevirtual
memory
assigned
to
this
process.Resource
Ownership
and
UtilizationResources
controlled
by
the
process
maybe
indicated,
such
as
opened
files.
A
history
outilization
of
the
processor
or
other
resourcealso
be
included;
this
information
may
be
needby
the
scheduler.4950Typical
Functions
of
an
OperatinSystem
KernelProcess
ManagementMemory
ManagementI/O
ManagementSupport
Functions51Typical
Functions
of
an
OperatingSystem
KernelProcess
Management–Process
creation
and
termination–Process
scheduling
and
dispatching–Process
switching–Process
synchronization
and
support
for
inter-pcommunication–Management
of
process
control
blocks52Typical
Functions
of
an
OperatingSystem
KernelMemory
Management–Allocation
of
address
space
to
processes–Swapping–Page
and
segmentmanagementI/O
Management–Buffer
management–Allocation
of
I/O
channels
and
devices
to
proces53Typical
Functions
of
an
OperatinSystem
KernelSupport
Functions–Interrupt
handling–Accounting–Monitoring54Modes
of
ExecutionUser
modeLess-privileged
modeUser
programs
typically
execute
in
this
mode
System
mode,
control
mode,
or
kernelmodeMore-privileged
modeKernel
of
the
operating
system
User
mode
changes
to
system
modewhen
interrupt
or
system
trap
occurs55Process
CreationAssign
a
unique
process
identifierAllocate
space
for
the
processInitialize
process
control
blockSet
up
appropriate
linkagesEx:
add
new
process
to
linked
list
used
foscheduling
queueCreate
or
expand
other
data
structureEx:
maintain
an
accounting
file56When
to
Switch
a
ProcessClock
interruptprocess
has
executed
for
the
maximumallowable
time
sliceI/O
interruptMemory
faultmemory
address
is
in
virtual
memory
so
itmust
be
brought
into
main
memory57When
to
Switch
a
Process
Trap
(re-execute
the
same
instructiowhen
resuming)error
or
exception
occurredmay
cause
process
to
be
moved
to
Exit
statSupervisor
callsuch
as
file
open58Change
of
Process
State(Process
Switch)
Save
context
of
processor
including
programcounter
and
other
registers
Update
the
process
control
block
of
theprocess
that
is
currently
in
the
Running
statthat
is
it
may
go
into
ready,
blocked
orsuspended
state,
other
fields
like
the
reasoleaving
the
current
state
&
accountinginformation
may
also
be
updated
Move
process
control
block
to
appropriatequeue
–
ready;
blocked;
ready/suspendSelect
another
process
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 母婴用品专业代购服务合作协议
- 遗产纠纷调节协议书
- 装修公司结算协议书
- 银行承兑抽屉协议书
- 酒店经营合伙协议书
- 首饰工厂订购协议书
- 乡村党建宣传栏协议书
- 餐厅设备租售协议书
- 跳舞团队免责协议书
- 解除劳务协议协议书
- 转让店铺轮胎协议书
- 2025年辽宁省盘锦市中考数学二模试卷
- 完整版新修订《厉行节约反对浪费条例》(课件)
- (区县版)-中小学教辅材料征订专项整治工作方案
- 文员岗位笔试试题及答案
- 2025年制冷工职业技能竞赛参考试题库(共500题含答案)
- 2024年河北承德辰飞供电服务有限公司招聘真题
- 小米集团2024年环境、社会及管治报告(ESG)
- 手机媒体概论(自考14237)复习题库(含真题、典型题)
- 晶圆缺陷检测算法-全面剖析
- 江苏省苏、锡、常、镇2025年高考物理三模试卷含解析
评论
0/150
提交评论