Operating Systems - Chapter 2: Processes and Process
Management
==============================================================
A process is a program in execution. It is a unit of work
in a modern time-sharing system.
Process Concept:
- A process includes the current activity (program counter,
processor registers)
- Stack containing temporary data (function parameters,
return addresses, local variables)
- Data section containing global variables
- Heap containing memory dynamically allocated during
runtime
Process 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
processor
- Terminated: The process has finished execution
Process Control Block (PCB):
Each process is represented in the operating system by a
process control block (PCB)
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory-management information
- Accounting information
- I/O status information
Process Scheduling:
The objective of multiprogramming is to have some process
running at all times to maximize CPU utilization.