Chapter 1: Process If Process
Running Processes and Scheduling
Definition of Running Process
A running process is defined as a process that is currently executing on the CPU. It is considered a correct answer in the context of operating systems and process management.
Ready State Processes
Ready State: Processes that are in the ready state are waiting for the CPU to execute them.
These processes are not actively executing but are prepared to be executed by the CPU.
They are simply waiting for the operating system's scheduler to allocate CPU time to them.
Scheduling Mechanism
Operating System Scheduler: The component of the operating system responsible for determining which process in the ready state is to be executed next on the CPU.
When a process in the ready state gets selected:
The process will begin its execution from the instruction indicated by its program counter.
The program counter points to the next instruction to be executed in the process's binary code.
Resumption of Execution
Upon being scheduled on the CPU, the resumption of execution can occur in two scenarios:
First Instruction Execution:
If the process is being executed for the first time (newly created), it will start from the very first instruction in the process's binary.
Random Instruction Execution:
If the process was previously interrupted (e.g., by the scheduler or due to needing to wait on an I/O operation or an external event), it will continue execution from the instruction it was last executing before the interruption.
This behavior highlights the interrupt handling capabilities of operating systems, where they save the state of a process to allow resumption later.