版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年版廣告投放合同詳細(xì)條款
- 學(xué)期家委會工作計劃六篇
- 中國紅酒包裝設(shè)計行業(yè)發(fā)展監(jiān)測及發(fā)展戰(zhàn)略規(guī)劃報告
- 中國單雙面膠粘帶項目投資可行性研究報告
- 中國鹽酸貝那普利行業(yè)市場供需格局及投資規(guī)劃建議報告
- 消費者效用最大化探究問卷調(diào)查報告
- 大學(xué)生電工實習(xí)報告錦集十篇
- 網(wǎng)頁課程設(shè)計備忘錄
- 2022年醫(yī)院后勤個人工作計劃
- 筷子課程設(shè)計教案
- 2024年機(jī)動車檢測站質(zhì)量手冊程序文件記錄表格合集(根據(jù)補充要求編制)
- 2023年冬季山東高中學(xué)業(yè)水平合格考政治試題真題(含答案)
- 中國特色大國外交和推動構(gòu)建人類命運共同體
- 《風(fēng)電場項目經(jīng)濟(jì)評價規(guī)范》(NB-T 31085-2016)
- 包裝設(shè)計化妝品包裝設(shè)計
- 各類傳染病個案調(diào)查表集
- 全口義齒PPT課件
- 室內(nèi)裝飾裝修工程施工組織設(shè)計方案(完整版)
- 工程竣工驗收備案申請表1
- XX光纖光纜產(chǎn)品公司護(hù)套工序工作標(biāo)準(zhǔn)
- 生產(chǎn)計劃流程內(nèi)容培訓(xùn)工廠生產(chǎn)線管理工作總結(jié)匯報PPT模板
評論
0/150
提交評論