In an operating system, a process can typically be in one of the following states:
New: A process enters the new or created state when it is first started. It is waiting to be admitted into the main memory in this condition, which is managed by the long-term scheduler. The procedure can move forward to the ready state after admission. Most systems will automatically approve admittance; however, real-time systems may defer this to minimize system overload.
Ready: In this stage, the process has been loaded into main memory and is waiting for CPU execution. It is placed in the ready queue and awaiting scheduling by the short-term scheduler or dispatcher. Multiple processes may be in the ready state at the same time, but only one process can be run on a single CPU core. The ready queue does not include processes that are ready for CPU execution but are awaiting other events (such as I/O).
Running: A process enters the running state when it is chosen for execution and its instructions are carried out by a CPU core. Only one process can run on each core at any given moment. Kernel mode is enabled when the system is doing essential OS activities or hardware operations. In User Mode, the process executes its instructions and data but is insulated from system resources.
Blocked (waiting): A process enters the blocked or waiting state when it requires an external event to continue. Examples include waiting for I/O activities (such as printer availability), user input, or access to important resources. Blocking is common when processes request access to shared resources, and synchronization objects (such as semaphores or mutexes) can be used to regulate access.
Terminated: Terminated refers to a process’s completion or explicit termination. The process is then marked as ended and will be removed from the process table. Before being completely deleted, it may remain as a zombie process until its parent process performs the wait system call to obtain its exit status. If not addressed, this can result in a resource leak.k (PCB) from memory.
Each of these stages corresponds to a certain stage in a process’s lifecycle, allowing the operating system to manage resources more efficiently and guarantee that processes run smoothly.