Process Managementprocess- unit of work- program in execution- active entityoperating system processes execute system codeuser processes execute user codebatch system – jobstime-share system – tasks, user programssingle user system – tasksProcess Structure- text section 0000o code- current stateo PCo IRo PSWo other registerso open fileso etc- process (user) stacko function parameterso return addresseso local variables- data sectiono global variables max address- heap memory mapo dynamically allocated memorystack section(contiguous)data sectionheap section(holes)text sectionprogram- executable code- passive entityMultiple processes many use the same code; e.g., multiple users may use the same program source on the server to edit individual programs; each user may get their own copy of a segment of the code, but it still constitutes multiple processes using the same codeState Diagram of Process Execution Process State- New – process is being created- Running – process is in a processor, i.e., program instructions are being executed- Waiting – process is waiting for some event to occur- Ready – process is waiting to be assigned to a processor- Terminated – process has finished execution New Process QueueMemory AllocatedReady Queue…P7P3P5P8CPUProcess Actively ExecutingTerminated ProcessMemory Deallocated…P6P3P9P4Event Wait QueueI/O Wait Queue …P1P2Process Control Block (PCB)(aka task control block)PCB contains- Process State – new, running, etc.- contents of the PC- contents of the CPU Registerso accumulatorso index registerso PSWo general-purpose registerso etc- CPU Scheduling Information- Memory Management Informationo page &/or segment tableso contents of base & limit register - Accounting Informationo CPU time usedo real time usedo process (job) numberso account numberso etc- I/O Status Informationo list of I/O devices allocated to the processo list of open fileso
View Full Document