Process Management in Operating Systems
Overview
- Process Management is a crucial function of the operating system.
- It involves managing program execution and allocation of CPU resources.
Important Terms
- CPU: Central Processing Unit
- Main Memory: Where active processes reside for execution.
- Secondary Memory: Where programs are stored when not in execution.
Program vs Process
- Program:
- A set of instructions saved in secondary memory.
- Example: Hello World in C++ (named
p1
).
- Process:
- A program that has been loaded into main memory for execution.
- Transitioned from a program in secondary memory to an active process in main memory.
CPU Execution
- The CPU executes one process at a time.
- Other processes are in a waiting state until the CPU is available.
- The Operating System manages the scheduling of these processes, determining which will run and when.
Ready Queue
- Ready Queue:
- A data structure holding all processes waiting for CPU allocation.
- Processes are organized in a queue (e.g.,
p1
, p2
, p3
) waiting their turn to be executed by the CPU.
Key Attributes of a Process
- Process ID: Unique identifier for each process.
- Process State: Current state of the process (e.g., new, ready, waiting).
- Details on state will be covered in a future tutorial.
- Program Counter:
- Holds the address of the next instruction to execute.
- Priority:
- Each process can have a priority level determining its allocation by the CPU. Higher priority processes may execute first.
- General-Purpose Registers: Specific registers held by the process.
- List of Open Files: Files currently in use by the process.
- List of Open Devices: Devices, such as printers, currently being accessed by the process.
- Protection Information: Details about any protection mechanisms in place for the process.
Scheduler and Scheduling
- Scheduler: The component responsible for assigning CPU time to processes.
- Different types of schedulers and their functionalities will be discussed in the next tutorial.
Conclusion
- Understanding programs and processes is essential for grasping how CPU execution works.
- The operating system effectively manages processes in the main memory, allowing for efficient CPU time allocation.
Thank you for listening! Please like and subscribe for more content.