Processes Concept Process Concept Process Scheduling Operations on Processes Interprocess Communication Process Concept Program: passive entity stored on disk (executable file) Process: active entity, program in execution in memory
A process includes:
Code segment (text section) Data section: global variables Stack: temporary local variables and functions Heap: dynamically allocated memory current activity: program counter, register contents A set of associated resources Threads lightweight process, basic unit of CPU utilization All threads belonging to the same process share the same code, data section, OS resources But each threads has its own thread ID, program counter, register set, stack Process State New: process is being created Ready: the process is in the memory waiting to be assigned to a processor Running: instructions are being executed by CPU, might be interrupt and switch to Ready state Waiting: process is waiting for some event to occur (I/O completion, etc) Terminated: process has finished execution Process Control Block (PCB) Info about each process
...