操作系統(tǒng)-第2章-進程與線程_第1頁
操作系統(tǒng)-第2章-進程與線程_第2頁
操作系統(tǒng)-第2章-進程與線程_第3頁
操作系統(tǒng)-第2章-進程與線程_第4頁
操作系統(tǒng)-第2章-進程與線程_第5頁
已閱讀5頁,還剩217頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

操作系統(tǒng)

第二章進程與線程

內(nèi)容

基礎:進程描述及控制

■■避免:死鎖與饑餓

??解決:幾個經(jīng)典問題

■關于:進程通信

。策略:進程調(diào)度

2

62.1ProcessDescriptionand

Control

Learningobjectiv

BytheendofthisIcctureyoushouIdbeabIcto

?ExpIainwhat5sProcess,SwappingandThread

?掌握分析進程的結構,PCB,Processimage(進程映像)

?描述進程的基本狀態(tài)及轉(zhuǎn)換規(guī)則與原因

?區(qū)別進程的掛起與阻塞狀態(tài)

?理解OS內(nèi)核的主要功能

?理解ProcessControIPrimitives(原語)

?區(qū)別ProcessSwitchingvs.ModeSwitching

?區(qū)別Processvs.Thread

MajorRequirementsofanOperating

System

?InterleavetheexecutionofseveraprocessestomaximizeprocessorutiIization

whiIeprovidingreasonabIeresponsetime

?AIlocateresourcestoprocesses

?Supportinterprocesscommunicationandusercreationofprocesses

程序的執(zhí)行順序

?程序順序執(zhí)行

■程序順序執(zhí)行時的特征:順序性、封閉性、可再現(xiàn)性

?程序并發(fā)執(zhí)行

■程序并發(fā)執(zhí)行時的特征:間斷性、非封閉性、不可再現(xiàn)性

?程序并發(fā)執(zhí)行條件(Bernstein條件)

■R(P1)nW(P2)UW(P1)HR(P2)UW(P1)HW(P2)={}

Process

?Alsocalledatask

?ExecutionofanindividuaIprogram

■進程是程序在一個數(shù)據(jù)集合上的運行過程,是系統(tǒng)進行資源分配和調(diào)度的

一個獨立單位

■進程是可并發(fā)執(zhí)行的程序在一個數(shù)據(jù)集合上的運行過程

?Canbetraced

■Iistthesequenceofinstructionsthatexecute

CharacteristicsofProcess

?Dynamic(動態(tài)性)

?Concurrency(并發(fā)性)

?Independent(獨立性)

?Asynchronous(異步性)

ProcessStructure

?Programs

?Datas

?PCB(ProcessControIBlock進程控制塊)

第8-9講進程狀態(tài)轉(zhuǎn)換

ProcessStates

?進程的并發(fā)執(zhí)行

?進程的2狀態(tài)

?進程的5狀態(tài)

?進程狀態(tài)轉(zhuǎn)換圖

假設內(nèi)存中有3個逆程A、B、C,他們的程序代碼已全部裝入內(nèi)存。若A、

C兩進程需要執(zhí)行12條指令,B進程需要執(zhí)行4條指令,且B進程執(zhí)行到第

4條指令處必須等待I/Oo如何跟蹤他們的執(zhí)行過程?

Figure3.1Snapshot<jfExampleExecution(Figure3」

ntlitslrixrtkmCyck13

Dispatcher

?操作系統(tǒng)重要組件

?負責進程、線程、作業(yè)的調(diào)度與分配

?提供多種調(diào)度算法如先來先服務、短作業(yè)優(yōu)先、時間片輪轉(zhuǎn)等

?監(jiān)測性能變化,如CPU使用率、10響應時間等

?Tiiheau

4|too

-1/0requ4ftlot

42。

io2

440log3

"e

47”

"溜

?

5|12010

521201

33C??M?4InnefPrw(?“e?fflgw*3al

Two-StateProcessModeI

?Processmaybeinoneoftwostates

■Running(執(zhí)行)

■Not-running(非執(zhí)行)

Dispatch

Pause

(a)Statetransitiondl曄ram

Not-RunningProcessinaQueue

注:

?并非所有進程只要Not-running就處于ready(就緒),有的需要blocked(阻塞)等待I/O完成

?Not-running又可分為ready和blocked兩種狀態(tài)

AFive-StateModeI

?Running(運行)

?Ready(就緒)

?Blocked(阻塞)

?New(創(chuàng)建)

?Exit(終止)

?Running:占用處理機(單處理機環(huán)境中,某一時刻僅一個進程占用處理機)

?Ready:準備執(zhí)行

?Blocked:等待某事件發(fā)生才能執(zhí)行,如等待I/O完成等

?New:進程已經(jīng)創(chuàng)建,但未被OS接納為可執(zhí)行進程

?Exit:因停止或取消,被OS從執(zhí)行狀態(tài)釋放

Admit

Fivure36Five-StateProcessModel

?NulIfNew:新創(chuàng)建進程首先處于新狀態(tài)

?NewfReady:OS接納新狀態(tài)進程為就緒進程

?Ready->Running:OS只能從就緒進程中選一個進程

執(zhí)行

?RunningExit:執(zhí)行狀態(tài)的進程執(zhí)行完畢,或被取

消,則轉(zhuǎn)換為退出狀態(tài)

?Running->Ready:分時系統(tǒng)中,時間片用完,或優(yōu)

先級高的進程到來,將終止優(yōu)先級低的進程的執(zhí)行

?Running6Blocked:執(zhí)行進程需要等待某事件發(fā)生。

通常因進程需要的系統(tǒng)調(diào)用不能立即完成,而阻塞

?Blocked-Ready:當阻塞進程等待的事件發(fā)生,就

轉(zhuǎn)換為就緒狀態(tài)

?Ready.Exit:某些系統(tǒng)允許父進程在任何情況下終

止其子進程。若一個父進程終止,其子孫進程都必須終

止。

?BlockedExit:同前

ProwM.A

Fi?ure3.6ProcessStatesforTrace<>fFi13J

UsingTwoQueues

Krnd,QIM-IM*

AdmitDh|Mtch

PFIKYWH-

Tlnw<Mit

E*ent1Queue

Kvcnl!Event1Wall

Occurs

E、cnt2Queue

Ewnl2Event2Wall

Occur.

E、cnl”Queue

>>cntn?cnlnWalt

Occurs

<blMuldnleblockedciueiws

Swapping(對換技術,交換技術)

將內(nèi)存中暫時不能運行的進程,或暫時不用的數(shù)據(jù)和程序,Swapping-out到

外存,以騰出足夠的內(nèi)存空間,把已具備運行條件的進程,或進程所需要的數(shù)

據(jù)和程序,Swapping-in內(nèi)存。

Swapping(對換技術,交換技術)

note

應該保證進程執(zhí)行時間比交換時間長

交換空間通常作為磁盤的一整塊,且獨立于文件系統(tǒng)

普通的交換技術一般很少使用,交換技術的一些變體任然在UNIX等系統(tǒng)中使用

SuspendedProcesses

?ProcessorisfasterthanI/OsoaIIprocessescouIdbe

waitingforI/O

?Swaptheseprocessestodisktofreeupmorememory

?Blockedstatebecomessuspendstatev/henswappedtodisk

ReasonsforProcessSuspension

SwappingTheoperatingsystemneedstoreleasesufficientmain

memorytobringinaprocessthatisreadytoexecute

OtherOSreasonTheoperatingsystemmaysuspendabackgroundorutility

processoraprocessthatissuspectedofcausingaproblem

InteractiveuserrequestAusermaywishtosuspendexecutionofaprogramfor

purposesofdebuggingorinconnectionwiththeuseofa

resource

TimingAprocessmaybeexecutedperiodically(eg.an

accountingorsystemmonitoringprocess)andmaybe

suspendedwhilewaitingforthenexttimeinterval

ParentprocessrequestAparentprocessmaywishtosuspendexecutionofa

descendenttoexamineormodifythesuspendedprocess,or

tocoordinatetheactivityofvariousdescendents

被掛起進程的特征

?不能立即執(zhí)行

?可能是等待某事件發(fā)生。若是,則阻塞條件獨立于掛起條件,即使

阻塞事件發(fā)生,該進程也不能執(zhí)行

?使之掛起的進程為:自身、其父進程、OS

?只有掛起它的進程才能使之由掛起狀態(tài)轉(zhuǎn)換為其他狀態(tài)

Suspendvs.BIocked(掛起與阻塞)

問題

1?是否只能掛起阻塞進程?

2?如何激活一個掛起進程?

Suspenvs.BIocked

d區(qū)分兩個概念:

??進程是否等待事件,阻塞與否

?進程是否被換出內(nèi)存,掛起與否

4種狀態(tài)組合:

?Ready:進程在內(nèi)存,準備執(zhí)行

Blocked:進程在內(nèi)存,等待事件

Ready,Suspend:進程在外存,只要調(diào)入內(nèi)存

即可執(zhí)行

Blocked,Suspend:進程在外存,等待事件

注:

處理機可調(diào)度執(zhí)行的進程有兩種:

?新創(chuàng)建的進程

?或換入一個以前掛起的進程

通常為避免增加系統(tǒng)負載,系統(tǒng)會換入一個以前掛起的進程執(zhí)行。

OneSuspendState

Admit

NewReady

Suspend

SuspendBlocked

此方案存在問題!

Twonewstates

—Blocked,suspend

—Ready,suspend

TwoSuspendStates

Acthate

Blnckd/

BUI

Stipend

(b)WithTwoSuspendStates

具有掛起狀態(tài)的進程狀態(tài)轉(zhuǎn)換

?BlockedBlocked.Suspend:OS通常將阻塞進程換出,

以騰出內(nèi)存空間

?BIocked,Suspend.Ready,Suspend:當BIocked,

Suspend進程等待的事件發(fā)生時,可以將其轉(zhuǎn)換為Ready,

Suspend

?Ready,SuspendReady:OS需要調(diào)入一個進程執(zhí)行時

?ReadyReady,Suspend:一般,OS掛起阻塞進程。但有

時也會掛起就緒進程,釋放足夠的內(nèi)存空間

?NewReady,Suspend(NewReady):新進程創(chuàng)建后,可

以插入到Ready隊列或Ready,Suspend隊列。若無足夠的內(nèi)

存分配給新進程,則需要NewReady,Suspend

具有掛起狀態(tài)的進程狀態(tài)轉(zhuǎn)換(續(xù))

?Blocked,SuspendBlocked:當BIocked,Suspend隊列中有一個進程的阻塞事

件可能會很快發(fā)生,則可將一個Blocked,Suspend進程換入內(nèi)存,變?yōu)锽locked

?RunningReady,Suspend:當執(zhí)行進程的時間片用完時,會轉(zhuǎn)換為Ready。

或,一個高優(yōu)先級的Blocked,Suspend進程正好變?yōu)榉亲枞麪顟B(tài),OS可以將執(zhí)

行進程轉(zhuǎn)換為Ready,Suspend狀態(tài)

?AIIExit;通常,RunningExito但某些OS中,父進程可以終止其子進程,

使任何狀態(tài)的進程都可轉(zhuǎn)換為退出狀態(tài)

ProcessDescription

?問題:

OS如何感知進程、控制進程及其所用的系統(tǒng)資源?

p〃

Virtiuil

Mem?y

ComfMitrr

Resources

3.9Prwessesa?dResources(reMMirceadkxrationat<HM?snapshotintime)

OperatingSystemControlStructures

?Informationaboutthecurrentstatusofeachprocessand

resource

?Tablesareconstructedforeachentitytheoperating

systemmanages

一MemoryTables

-I/OTables

FiIeTables

ProcesTable

Fimirc3.10Genera]Structure*OiM*ratiiwSystemControlTnNc

MemoryTables

?AIlocationofmainmemo-ytoprocesses.

?AIlocationofsecondarymemorytoprocesses.

?Protectionattributesforaccesstosharedmemoryregions.

?InformalionneededtomanagevirtuaImemory(虛擬存儲)

I/OTables

?I/OdeviceisavailabIeorassigned.

?Statusof1/0operation.

?Locationinmainmemorybeingusedasthesourceor

destinationofthe1/0transfer.

FiIeTables

?Existenceoffiles.

?Locationonsecondarymemory.

?CurrentStatus.

?Attributes.

?Some!imesthisinformationismaintainedbyafiIe-managementsystem.

ProcessTabIe

?Whereprocessislocated.

?Attributesnecessaryforitsmanagement.

?ProcessID

?Processstate

?Locationinmemory

ProcessLocation

?ProcessincIudessetofprogramstobeexecuted.

?DatalocationsforIocaIandglobaIvariables.

?Anydefinedconstants.

?Stack.

?ProcesscontroIbIock(PCB)

?CoIlectionofattributes.

?Processimage(進程映像)

?CoIlectionofprogram,data,stack,andattributes.

Processimage

?UserData

?UserProgram

?SystemStack:存放系統(tǒng)及過程調(diào)用地址、參數(shù)

?ProcessControIBlock(PCB):OS感知進程、控制進程的數(shù)據(jù)結構

ProcessControIBlock

?簡稱PCB:是OS控制和管理進程時所用的基本數(shù)據(jù)結構

?作用:PCB是相關進程存在于系統(tǒng)中的唯一標志;系統(tǒng)根據(jù)PCB而感知相關

進程的存在。

?內(nèi)容:通常情況下,PCB包含Identifiers(標識)、狀態(tài)、控制、指針等

多種信息。

ProcessControIBlock(PCB)

?Processidentification

?Identifiers

?Identifierofthisprocess(進程ID)

?Identifieroftheprocessthatcreated

thisprocess(parentprocess)(父進程ID)

?Useridentifier(用戶ID)

ProcessControIBlock

?ProcessorStateInformation

■User-VisibIeRegisters(用戶可見寄存器)

?Auser-visibleregisterisonethatmaybereferencedbymeans

ofthemachineIanguagethattheprocessorexecutes.

?Typically,therearefrom8to32oftheseregisters,although

someRISCimplementationshaveover100.

ProcessControIBlock

?ProcessorStateInformation

?ControIandStatusRegisters

Thereareavarietyofprocessorregistersthatareemployedto

controItheoperationoftheprocessor.Theseinclude

?Programcounter:Containstheaddressofthe

nextinstructiontobefetched.

?Conditioncodes:ResuItofthemostrecent

arithmeticorlogicaIoperation(e.g.rsign,

zero,carry,equaI,overflow).

?Statusinformation:Includesinterrupt

enabled/disabledflags,executionmode.

ProcessControIBlock

?ProcessorStateInformation

?StackPointers

?Eachprocesshasoneormorelast-in-first-out(LIFO)

systemstacksassociatedwithit.

?AstackisusedtostoreparametersandcaIIing

addressesforprocedureandsystemcaIIs.

?Thestackpointerpointstothetopofthestack.

ProcessControIBlock

?ProcessControlInforma11on

?ScheduIingandStateInformation

?Processstate:definesthereadinessofthe

processtobescheduledforexecution(e.g.,

running,ready,waiting,haIted).

?Priority:OneormorefieIdsmaybeusedto

describethescheduIingpriorityofthe

process.

?Scheduling-relatedinformation:ThiswiII

dependonthescheduIingaIgorithmused.

?Event:Identityofeventtheprocessis

awaitingbeforeitcanberesumed

ProcessControIBlock

?ProcessControIInformation

?DataStructuring

?AprocessmaybeIinkedtootherprocess

inaqueue,ring,orsomeotherstructure.

?Aprocessmayexhibitaparent-chiId

(creator-created)reIationshipwith

anotherprocess.

?TheprocesscontroIblockmaycontain

pointerstootherprocessestosupport

thesestructures.

ProcessControIBlock

?ProcessControIInformation

?IntorprocessCommunication

?Variousflags,signaIs,andmessagesmaybeassociated

withcommunicationbetweentwoindependentprocesses.

?ProcessPrivileges

?Processesaregrantedprivilegesintermsofthememory

thatmaybeaccessedandthetypesofinstructionsthat

maybeexecuted.

ProcessControIBlock

?ProcessControIInformation

?MemoryManagement

?Thissectionmayincludepointerstosegment

and/orpagetablesthatdescribethevirtuaI

memoryassignedtothisprocess.

?ResourceOwnershipandUtiIization

?ResourcescontroIledbytheprocessmaybe

indicatedysuchasopenedfiles.Ahistory

ofutiIizationoftheprocessororother

resourcesmayaIsobeincluded;this

informationmaybeneededbythescheduIer.

ProcessControIBlock

Pnxr^

kknlinoiliimkknllfk?atk?iklrntlfkjitlim

1PFWTM%

FrucnaurStaleFroreMTStaleFruce?oStaleL<

InformationInformationInfurmatiuafBlock

Prncf('untruiFrwe*CunlruiC<jolrt4

InhirmilliMiInTormnllimInhirmatkm

[RrStockl?erSUK<txrsuct

FrhateIwrFrhateIwFfivateIf

AcklreviSpacrAcklFMSpacrAckirmSpore

<Fru(*ramNDaUi?(Prufu-an*^Dalai<Pruuram.DaUi

ShftrcdActinoSharedAdrtmftSharedAddrvw

SpaceSpaceSpace

Pnwv^1FnrKVM2PFIKV^A.

Figure3.12txerPrixTe-Memory

TypicalFunctionofanOSKernel(資源管理功能)

?ProcessManagement:進程創(chuàng)建和終止、調(diào)度、狀態(tài)轉(zhuǎn)換、同步和通

信、管理PCB

?MemoryManagement:為進程分配地址空間、對換、段/頁管理

?I/OManagement:緩存管理、為進程分配I/O通道和設備

TypicalFunctionofanOSKernel(支撐功能)

?InterrupthandIing(中斷處理)

?Timing(時鐘管理)

?Primitive(原語):AtomicOperation

?Accounting(統(tǒng)計)

?Monitoring(監(jiān)測)

ProcessControIPrimitives(原語)

?ProcessSwitch,進程切換

?CreateandTerminate,創(chuàng)建與終止

?BlockandWakeup,阻塞與喚醒

?SuspendandActivate,掛起與激活

WhentoSwitchaProcess

?Clockiinterrupt

?processhasexecutedforthemaximumaIlowabIetimesIice

(時間片)

?I/Ointerrupt

?MemoryfauIt(存儲訪問失效)

?memoryaddressisinvirtuaImemorysoitmustbebrought

intomainmemory

WhentoSwitchaProcess

?Trap(陷阱)

?erroroccurred

?maycauseprocesstobemovedtoExitstate

?SupervisorcaII(管理程序調(diào)入)

?suchasfiIeopen

ChangeofProcessState

?SavecontextofprocessorincIudingprogramcounterandotner

registers

?UpdatethePCBoftheprocessthatiscurrentlyrunning

?MovePCBtoappropriatequeue-ready,bIocked

?Selectanotherprocessforexecution

ChangeofProcessState

?UpdatethePCBoftheprocessselected

?Updatememory-managementdatastructures

?Restorecontextoftheselectedprocess

ProcessSwitchingvs.Mode

Switching

?ProcessSwitch,是作用于進程之間的一種操作。

當分派程序收回當前進程的CPU并準備把它分派

給某個就緒進程時,該操作將被引用。

?ModeSwitch,是進程內(nèi)部所引用的一種操作。當

進程映像所包含的程序引用核心子系統(tǒng)所提供的

系統(tǒng)調(diào)用時,該操作將被引用。

ProcessGreation

?Submissionofabatchjob

?UserIogson

?Createdtoprovideaservicesuchasprint

?Processcreatesanotherprocess

ProcessGreation(creat。原語,步

驟)

1.為進程分配一個唯一標識號ID:主進程表中增加一個新的表項

2?為進程分配空間:用戶地址空間、用戶??臻g、PCB空間。若

共享已有空間,則應建立相應的鏈接。

3.初始化PCB:進程標識、處理機狀態(tài)信息、進程狀態(tài)

4.建立鏈接:若調(diào)度隊列是鏈表,則將新進程插入到就緒或(就

緒,掛起)鏈表

5.建立或擴展其他數(shù)據(jù)結構

ProcessTermination(終止)

?BatchjobissuesHalt\nstruction

?Userlogsoff

?Quit(退出)anappIication

?ErrorandfauItconditions

ReasonsforProcessTermination

?NormaIcompletion,正常結束

?TimeIimitexceeded,超時終止,執(zhí)行時間超過預計時間

?MemoryunavaiIable,內(nèi)存不足,無法為進程分配所需的內(nèi)存空間

?Boundsviolation,越界訪問

?Protectionerror,企圖使用未允許用的數(shù)據(jù),或操作方式錯

?Arithmeticerror,計算錯,如除零,或企圖存儲硬件允許的最大數(shù)

?Timeoverrun,超時等待某事件發(fā)生

ReasonsforProcessTermination

?I/Ofailure,如找不到文件或多次重試仍無法讀寫文件,或無效操作

?InvaIidinstruction,企圖執(zhí)行不存在的指令

?PriviIegedinstruction,企圖執(zhí)行特權指令

?Datamisuse,數(shù)據(jù)類型不符,或未初始化

?Operatingsystemintervention,操作員或OS干預,如發(fā)生死鎖的時候

?Parentterminates,sochiIdprocessesterminate

?Parentrequest

ProcessTermination(destroy。原語,

步驟)

1.根據(jù)被終止進程的標識符ID,找到其PCB,讀出該進程的狀態(tài);

2.若該進程為執(zhí)行狀態(tài),則終止其執(zhí)行,調(diào)度新進程執(zhí)行;

3.若該進程有子孫進程,則立即終止其所有子孫進程

4.將該進程的全部資源,或歸還給其父進程,或歸還給系統(tǒng)

5.將被終止進程(的PCB)從所在的隊列中移出,等待其它程序來

搜集信息

ProcessBlockandWakeup(阻塞的原

因)

?請求系統(tǒng)服務

?啟動某種操作:如I/O

?新數(shù)據(jù)尚未到達

?無新工作可做

ProcessBIockandWakeup(原語)

?阻塞原語block。

當出現(xiàn)阻塞事件,進程調(diào)用阻塞原語將自己阻塞。狀態(tài)

變?yōu)椤白枞麪顟B(tài)”,并進入相應事件的阻塞隊列

?喚醒原語wakeup()

當阻塞進程期待的事件發(fā)生,有關進程調(diào)用喚醒原語,

將等待該事件的進程喚醒。狀態(tài)變?yōu)镽eady,插入就緒隊列

ProcessBIockandWakeup(原語)

?掛起原語suspend()

當出現(xiàn)掛起事件,系統(tǒng)利用掛起原語將指定進程或阻

塞狀態(tài)進程掛起。進程從內(nèi)存換到外存,狀態(tài)改變:

ReadyReady,Suspend;BIocked

Blocked,Suspend,插入相應隊列

?激活原語active()

當激活事件發(fā)生,系統(tǒng)利用激活原語將指定進程激活。

進程從外存換入到內(nèi)存,狀態(tài)改變:Ready.Suspend

Ready;Blocked,SuspendBlocked,插入相應隊列

Thread(線程)

?Anexecutionstate(running,ready,etc.)

?Savedthreadcontextwhennotrunning.

?Hasanexecutionstack.

?Someper-threadstaticstorageforIocaIvariables.

?Accesstothememoryandresourcesofitsprocess.

?aIIthreadsofaprocesssharethis.

Siiigle-llirviMiccIMultitlireaded

Prix^ssModelPr<>cv**sModel

Iser

Acklre**

Space

Eiuiire4.2SingleThreudvdandMultithreadedProcessMcxkls

BenefitsofThreads

?Takeslesstimetocreateanewthreadthana

process.

?Lesstimetoterminateathreadthanaprocess.

?Lesstimetoswitchbetweentwothreadswithin

thesameprocess.

?Sineethreadswithinthesameprocessshare

memoryandfiIes,theycancommunicatewith

eachotherwithoutinvokingthekerneI.

Threads

?SuspendingaprocessinvoIvessuspendingaIIthreadsof

theprocess

?sinceaIIthreadssharethesameaddressspace.

?Terminationofaprocess,terminatesaIIthreadswithin

theprocess.

MuItithreading

?OperatingsystemsupportsmuItipIethreadsof

executionwithinasingIeprocess.

?MS-DOSsupportsasingIethread.

?UNIXsupportsmuItipIeuserprocessesbutonIy

supportsonethreadperprocess.

?Windows2000,SoIaris,Linux,Mach,andOS/2

supportmuItipIethreads.

rmiltlpirpnmw*multiplepnCTM**

oneIhrvxlperpncwmultiplethrvachperpr1n

ImtriKtliiciIrace

Eiuure4.1TlirvmlsaixiPr?MessrsIANDE97

ThreadStates

?KeystatesforathreadRunning,Ready,Blocked.

?Operstionsassociatedwithachangeinthreadstate.

?Spawn(派生),Spawnanotherthread

?Block

?Unblock

?Finish

User-LeveThreads

?AIIthreadmanagementisdonebytheappIication.

?ThekerneIisnotawareoftheexistenceofthreads.

?描述此類線程的數(shù)據(jù)結構以及控制此類線程的原語在核外子系統(tǒng)中實現(xiàn)。

KerneI-LeveIThreads

?W2KrLinux,andOS/2areexamplesotthisapproach.

?Ker

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論