Process States
- New State: In this step, the process is about to be created but not yet created. It is the program that is present in secondary memory that will be picked up by the OS to create the process.
- Ready State: Once the process is prepared to run and waiting for CPU time, it moves to the Ready state. In this state, the process is ready to execute but is waiting for the CPU to be assigned to it.
- Running State: When the CPU picks the process from the ready queue, the process transitions to the Running state. This is where the process is actively being executed by the CPU.
- Blocked/Waiting State: If the running process needs to perform an I/O operation or wait for some event (like file access or user input), it transitions to the Blocked/Waiting state. The process remains here until the required I/O operation is completed or the event occurs.
- Ready State (again): After the I/O operation or event is completed, the process returns to the Ready state, waiting again for CPU time to continue execution.
- Terminated State: Once the process has completed its execution or if it is terminated (e.g., due to an error or being killed), it moves to the Terminated state. At this point, the process is cleaned up by the operating system, and its resources are released.
Job Scheduler
The job scheduler, also known as the long-term scheduler, is a vital component of an operating system responsible for managing the admission of processes into the system's main memory. Its primary role is to decide which processes from the New state (where they reside in secondary storage) should be brought into the Ready state (where they are placed in main memory and prepared for execution). The job scheduler evaluates system load and available resources, such as memory and CPU capacity, to make these decisions. By selecting processes based on criteria like priority, process size, and system policies, it ensures an optimal balance between system performance and resource utilization. Once selected, processes are loaded into main memory and moved to the Ready queue, where they wait for CPU time. This management helps maintain system stability and efficiency by controlling the number of active processes in memory at any given time.
CPU Scheduler
The CPU scheduler (also known as the short-term scheduler) is responsible for deciding which process from the Ready queue should be transferred to the Running state.

Good Job
ReplyDelete