52
Operating Systems OPERATING SYSTEMS: Lesson 3: Introduction to Process Management 1 Jesús Carretero Pérez David Expósito Singh José Daniel García Sánchez Francisco Javier García Blas Florin Isaila

OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

OPERATING SYSTEMS:

Lesson 3:Introduction to Process Management

1

Jesús Carretero PérezDavid Expósito SinghJosé Daniel García SánchezFrancisco Javier García BlasFlorin Isaila

Page 2: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

2

Page 3: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Process

• Process:Programinexecution.– Eachexecutionofaprogramleadstoaprocess.– Processistheunitofmanagementforoperatingsystem

• Aprocessconsistsof:– Programtext:Instructions.– Setofdataassociatedtoprogramexecution.

3

Page 4: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Programexecution

ExecutableProgram

A

Mai

n M

emor

y

Process A1

Process A2

4

Page 5: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryrepresentation

• Aprocessneedsmemoryforinstructionsanddata.

• Differentinstancesofaprogramneedindependentareasfordata.

text

data

heap

stack

5

Page 6: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

6

Page 7: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Basiclifecycleofprocess

Running

BlockedReady

Wait an event

End of event blocking

Time-slicefinished

Activation

As many asprocessors

7

New processes

Fin

Page 8: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Simplifiedqueuingmodel:Singleprocessor

Processor

Ev 1

New processes Finished processes

Ev 2

Ev 3…

End of time-slice

8

Page 9: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Simplifiedqueuingmodel:Multipleprocessors

Processor

Ev 1

New processes

Ev 2

Ev 3

End of time-slice

FinishedProcesses

9

Page 10: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

10

Page 11: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Processinformation

• Alltheinformationallowingtheprocesscorrectexecution.

• Threecategories:– Informationstoredintheprocessor.– Informationstoredinmemory.– Additionalinformationmanagedbyoperatingsystem.

11

Page 12: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Processorstate

¨Processorstateincludesvaluesofprocessorregisters.¤Registersaccessibleinusermode.

¤ Generalregisters: Registerfile.¤ Programcounter.¤ Stackpointer.¤ Userpartinstatusregister.

¤Registersaccessibleinprivilegedmode:n Privilegedpartfromstatusregister.nMemorymanagement registers(e.g.PTBR).

¨Contextswitch:¨ Saveprocessorstateforoutgoingprocess.¨ Restoreprocessorstateforincomingprocess.

12

Page 13: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryimageofaprocess

¨Memoryimageconsistsofthememoryspacesthataprocessisauthorizedtouse.

¨Ifaprocessgeneratesanaddressoutoftheaddressspace,hardwaregeneratesatrap.

¨Dependingonspecificcomputer,memoryimagemaybereferredtovirtualmemoryorphysicalmemory.

13

Page 14: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryimagemodels:Singleregion

• Processwithasinglefixedsizeregion.– Usedinsystemswithoutvirtualmemory.

• Processwithasinglevariablesizedregion.– Systemswithoutvirtualmemory:

• Needreservespace" Memorywaste.

– Systemswithvirtualmemory:• Virtualreservespace" Feasiblebutlessflexiblethanmultipleregion.

• Notused.

14

Page 15: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryimagemodels:Multipleregions

• Processwithfixednumberofregionsofvariablesize.– Prefixedregions(text,data,stack).– Eachregionmaygrow.– Withvirtualmemory,theholebetweenstackandheapdoesnotconsumeresources.

text

data

stack

15

Page 16: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryimagemodels:Multipleregions

• Processwithvariablenumberofregionsofvariablesize.– More advancedoption(usedincurrentversionsinWindowsandUNIX).

– Processstructuredasanumberofregions.– Veryflexible:

• Sharedregions.• Regionsmaydifferinpermissions.

16

Page 17: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Operatingsysteminformation

17

• Operatingsystemkeepsadditionalinformationonprocesses.

• Operatingsystemkeepsinformationinatable:ProcessTable.

• ProcessControlBlock (PCB):Eachentryintablekeepsinformationaboutoneprocess.

• AlmostallinformationaboutprocessstoredinPCB.nSomeinformationelementskeptoutsideduetoimplementationreasons.

Page 18: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Example:•Process identification.•Parent process identification.•User information.

ContenidosdelBCP

• Identificationinformation.

• Processorstate.• Processcontrolinformation.

18

On process start:•Initial values for processor state.After context switch:•Copy state values to processor.

Scheduling and state information:•Process state.•Waited event (if blocked).•Process priority.•Scheduling information.Allocated regions description.•Per region information.Allocated resources:•Open files.•Used communication ports.•Timers.Pointers for structuring process queues (or rings).Information for inter process communication.

Page 19: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

InformationoutofPCB

• NotalltheinformationreferredtoaprocessisstoredinitsPCB.

• Decisiontakeninfunctionof:– Efficiency.

• Tablesshouldhaveaprefixedsizeandalwaysbeinmemory.• Sizeneedstobeoptimized.

– InformationSharing.• IfdataneedstobeshareditcannotbeinthePCB.• Pointersareusedtopointtootherstructures (tables)allowingforinformation sharing.

– Openfiles.– Memorypages.

19

Page 20: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

PageTable

• PlacedoutsidePCB.

• Describesprocessmemoryimage.• PCBcontainspointertopagetable.• Reasons:

– Variablesize.– MemorysharingamongprocessesrequiresittobeexternaltoPCB.

20

Page 21: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Filepositionpointers

• PlacedoutsidePCB.

• Ifaddedtoopenfilestable(inPCB)cannotbeshared.

• Ifassociatedtoi-nodeisalwaysshared.

• StoredinacommonstructureformultipleprocessesandanewoneallocatedwithOPENservice.

21

Page 22: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Example:Runningacommand

#include <sys/types.h>

#include <stdio.h>int main(int argc, char** argv) {pid_t pid;pid = fork();switch (pid) {

case -1: /* error */exit(-1);

case 0: /* proceso hijo */if (execvp(argv[1], &argv[1])<0) { perror(“error”); }break;

default:printf(“Proceso padre”);

}

return 0;}

prog cat f1

22

Page 23: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Forkservice

• pid_t fork(void);

¨ Duplicatesprocessinvokingthecall.¨ Parentprocessandchildprocessgoonrunningthesameprogram.¨ Childprocessinheritsopenfilesfromparentprocess.

¨ Openfiledescriptorsarecopied.¨ Pendingalarmsaredeactivated.

• Returns:– -1onerror.– Inparentprocess:childprocessdescriptor.– Inchildprocess:0.

23

Page 24: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Forkservice

24

Process A

Process A’

FORK

Page 25: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Execservice

• Singleservicewithmultiple libraryfunctions.int execl(const char *path, const char *arg, ...);int execv(const char* path, char* const argv[]);int execve(const char* path, char* const argv[], char* const envp[]);int execvp(const char *file, char *const argv[])

• Changescurrentprocessimage.– path:pathtoexecutable file.– file:LooksfortheexecutablefileinalldirectoriesspecifiedbyPATH.

• Description:– Returns-1onerror,otherwiseitdoesnotreturn.– Thesameprocessrunsanotherprogram.– Openfilesremainopen.– Signalswithdefaultactionremaindefaulted,signalswithhandlertakedefault

action.

25

Page 26: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Execservice

26

Process A

Proceso A’

EXEC

Process B

Page 27: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Exitservice

• Finalizesprocessexecution.

void exit(status);

• Allopenfilesdescriptorsareclosed.• Allprocessresourcesarereleased.• PCB (ProcessControlBlock)isreleased.

27

Page 28: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

28

Page 29: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Operatingsystemtypes

Operating Systems

Multiprocess(several processes

running)

Multiuser(several users

at a time)

Monouser(a single user

at a time)

Monoprocess(single process)

Monouser(a single user at a

time)

29

Page 30: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Principlesofmultitasking

• RealparallelismbetweenI/OandCPU(DMA).• ProcessalternatebetweenI/Oandprocessingphases.

• Severalprocessesstoredinmemory.

30

Page 31: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Advantagesofmultitasking

• Easesprogramming,dividingaprograminmultipleprocesses(modularity).

• Allowssimultaneousinteractiveserviceofmultipleusersinanefficientway.

• TakesadvantageoftimesaprocessspendswaitingforanI/Ooperationtobecompleted.

• IncreasesutilizationofCPU.

31

Page 32: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Multiprogrammingdegree

• Multiprogrammingdegree:Numberofactiveprocesses.

• Mainmemoryneeds:Systemwithoutvirtualmemory.

32

100%

Multiprogramming degree

% C

PU u

tiliz

atio

n

Page 33: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Multiprogramming:CPUuse

1 process

2 processes

Execution

I/O

33

Page 34: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Multiprogrammingandvirtualmemory

• Systemswithvirtualmemory:– Divideaddressingspaceofprocessesinpages.– Dividephysicalmemoryaddressingspaceinmainmemoryinpageframes.

• Atagiventime,eachprocesshasacertainnumberofitspagesinmainmemory(residentset).

34

Page 35: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Memoryneeds:Virtualmemorysystem

Page

fram

es p

er p

roce

ss

Multiprogramming degree

35

Page 36: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Performance:Smallphysicalmemory

¨Whenmultiprogrammingdegreeincreases:¨ Residentsetsize

decreasesforeachprocess.

¨TrashinghappensbeforeachievingahighCPUutilizationpercentage.

¨Solution:Addmoremainmemory.

100%

Multiprogramming degree

% C

PU u

tiliz

atio

n

36

Page 37: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Performance:Largephysicalmemory

• Whenmultiprogrammingdegreeincreases:– Residentsetsizedecreasesfor

eachprocess.

• HighCPUutilizationpercentageisachievedwithlessprocessesthatfitinmemory.

• Solution:Improveprocessororaddmoreprocessors.

100%

Multiprogramming degree

% C

PU u

tiliz

atio

n

37

Page 38: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

38

Page 39: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contextswitching

• Whenoperatingsystemassignsprocessortoanewprocess.

• Actions:– SaveprocessstateinPCBforprocessinexecution.– Restorestateofnewprocessinprocessor.

39

Page 40: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contextswitch

Save state in PCB0

Restore state from PCB1

Save state in PCB1

Restore state from PCB0

40

Page 41: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contextswitchingtypes

¨Voluntarycontextswitch:¤ Processperformscalltooperatingsystem(orgeneratesexceptionlike

pagefault)implyingwaitingforanevent.¤Running" Blocked.¤ Examples:readingfromterminal,pagefault.¤Reason⇒ Processoruseefficiency.

¨ Involuntarycontextswitch:¤OSappropriatesCPU.¤Running" Ready.¤ Examples:timesliceellapsed orprocessmovesfromblockedtoready

andhashigherpriority.¤Reason⇒ Processorusesharing

41

Page 42: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Contents

¨Processconcept.¨Basiclifecycleofaprocess.¨Processinformation¨Multitasking.¨Contextswitch.¨Generatinganexecutable.

42

Page 43: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Executablegeneration

Linker (ld)

Compiler

a.c

a.o

Compiler

b.c

b.o

p

Relocatable object files separately generated

Executable object file (contains code and data for all defined functions in a.c and b.c).

43

Page 44: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

LinkEditor(linker)

n Combinesobjectfiles:¨ Mergesseveralrelocatableobjectfiles(.o)inasingle

executableobjectfile:inputforloader.

n Resolvesexternalreferences:¨ Referencestosymbolsdefinedinotherobjectfile.

n Relocatessymbols:n Fromrelativepositionsin.otoabsolutepositionsin

executable:adjustrefstothesenewpositions.n Symbols:refstofunctionsanddata.

44

Page 45: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Ejemplo:FormatoELF

n ELF:ExecutableandLinkableFormat

¨ formatobinarioestándarparaficherosobjeto¨ originaldeSystemVà BSD,Linux,Solaris¨ formatounificadopara:

n ficherosobjetoreubicablesn ficherosobjetoejecutablesn ficherosobjetocompartidos

45

Page 46: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

ELFformat

ELF header

Program header table(required for executables)

.text section

.data section

.bss section

.symtab

.rel.txt

.rel.data

.debug

Section header table(required for relocatables)

0

Code

“block started bysymbol” Non-

initialized staticdata

Type (.o, .exe, .so, etc); machine; Big /Little end; etc

Symbol table

Relocationinfo

Iinitialized staticdata

46

Page 47: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Executableload

ELF header

Program header table(required for executables)

.text section

.data section

.bss section

.symtab

.rel.text

.rel.data

.debug

Section header table(required for relocatables)

0

.text segment(r/o)

.data segment(initialized r/w)

.bss segment(uninitialized r/w)

Process image

0x08048494

init and shared libsegments

0x080483e0

Virtual addr

0x0804a010

0x0804a3b0

MEMORYDISK

47

Page 48: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Staticlibrary

Compiler

a.c

a.o

Compiler

b.c

b.o libc.aStatic library: file with contatenation of relocatableobject files.

Executable object file: includes code from functions in libc used in the program.

Linker (ld)

p

48

Page 49: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Staticanddynamiclibraries

n Drawbacksofstaticlibraries:¨ Codepotentiallyduplicatedinexecutables:

¨ Disk(filesystem).¨ Virtualmemoryspaceinprocesses.

¨ Bugsinlibraries" newversion" needtorelink

n Solution:dynamiclibraries(*.so) (dynamiclinklibraries,DLLs):n Componentsloadedinmemoryandexecutedatruntime.n Functionsfromlibrariesmaybesharedamongmultipleprocesses.

49

Page 50: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Dynamiclibraries

Functions from libc.so and invoked from a.c and b.c are loaded and linked.Potentially shared among multiple processes.

Shared library

Compiler

a.c

a.o

Compilerb.c

b.o

libc.so

Linker (ld)

p

Cargador / Enlazador dinámico

(ld-linux.so)

Executable in memory P’50

Page 51: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

Reminder

¨ Differencebetweenprogramandprocess.¨ Aprocessisaporgram inexecution.

¨ Operatingsystemmanagesrunningprocesses(processlifecycle).¨ Processinformationconsistingof:processstate,memoryimage

andPCB.¨Multitaskingallowsabetteruseofcomputerresources.¨ Contextswitchingintroducesasmalloverhead.¨ Staticlibrariesarelinkedatcompiletimewhiledynamiclibraries

arelinkedatprocesscreationtime.¨ Processcreationimpliescreationofitsmemoryimageandthe

allocationofaPCB.

51

Page 52: OPERATING SYSTEMS: Lesson 3: Introduction to Process ...ocw.uc3m.es/ingenieria-informatica/operating...Operating Systems Process • Process: Program in execution. – Each execution

OperatingSystems

OPERATING SYSTEMS:

Lesson 3:Introduction to Process Management

52

Jesús Carretero PérezDavid Expósito SinghJosé Daniel García SánchezFrancisco Javier García BlasFlorin Isaila