PROCESS CONCEPT o An operating system executes a variety of programs: ·Batch system-jobs Time-shared systems-user programs or tasks o Textbook uses the terms job and process almost interchangeably o Process-a program in execution;process execution must progress in sequential fashion o A process includes: ·program counter Stack:for local variables Heap:for dynamically allocated memory data section:for global,static data member,static varible o text section:for code,all the compile generated code stored in this area
PROCESS CONCEPT An operating system executes a variety of programs: Batch system – jobs Time-shared systems – user programs or tasks Textbook uses the terms job and process almost interchangeably Process – a program in execution; process execution must progress in sequential fashion A process includes: program counter Stack: for local variables Heap: for dynamically allocated memory data section: for global, static data member, static varible text section: for code, all the compile generated code stored in this area
PROCESS STATE o As a process executes,it changes state new:The process is being created ● running:Instructions are being executed waiting:The process is waiting for some event to occur ready:The process is waiting to be assigned to a process o terminated:The process has finished execution
PROCESS STATE As a process executes, it changes state new: The process is being created running: Instructions are being executed waiting: The process is waiting for some event to occur ready: The process is waiting to be assigned to a process terminated: The process has finished execution
DIAGRAM OF PROCESS STATE new admitted interrupt exit terminated ready running 1/O or event completion scheduler dispatch 1/O or event wait waiting
DIAGRAM OF PROCESS STATE
PROCESS CONTROL BLOCK (PCB) Information associated with each process o Process state o Program counter o CPU registers o CPU scheduling information o Memory-management information o Accounting information o I/O status information
PROCESS CONTROL BLOCK (PCB) Information associated with each process Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O status information
SCHEDULERS o Long-term scheduler (or job scheduler) - selects which processes should be brought into the ready queue oShort-term scheduler (or CPU scheduler)-selects which process should be executed next and allocates CPU
SCHEDULERS Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU