Computer Science – 16.1 Purposes of an Operating System (OS) | e-Consult
16.1 Purposes of an Operating System (OS) (1 questions)
A process goes through several states during its lifecycle, typically including: New, Ready, Running, Blocked/Waiting, and Terminated.
New: The process is being created. It exists as a process control block (PCB) in the OS's process table.
Ready: The process is ready to execute but is waiting for the CPU to become available. It resides in the ready queue.
Running: The process is currently being executed by the CPU. Only one process can be in the running state at any given time on a single-core processor.
Blocked/Waiting: The process is waiting for an event to occur, such as I/O completion or a signal. It is removed from the ready queue and placed in a waiting queue.
Terminated: The process has completed its execution and is no longer in memory. Its PCB is removed from the process table.
The operating system manages transitions between these states through a scheduler. The scheduler selects which process to run based on scheduling algorithms (e.g., Round Robin, Priority Scheduling). Context switching is the process of saving the state of the currently running process (its registers, program counter, etc.) and loading the state of the next process to be executed. This allows the OS to quickly switch between processes, giving the illusion of concurrent execution. Context switching is a crucial part of multitasking and enables efficient utilization of the CPU.