Process: A process us a sequential program in execution. The components of a process are the following
The Object Program (or code) to be executed.
The data on which the program will execute
Resources required by the program
The status of Program execution
CPU Burst (Usage Time): The amount of time a process needs to be in the running state before it is completed
Turnaround Time : The amount of time between the moment of process first enters the ready state and the moment the process exits the running state for the last time.
Waiting Time : The time the process spends waiting in the ready state before its first transition to the running state.
Time Quantum (time slice): The amount of time between timer interrupts. (Used when process manager use an interval timer).
The scheduling policy determines when it is time for a process to be removed from the CPU and which ready process should be allocated the CPU next.
Preemptive: A strategy for time-multiplexing the processor whereby a running process is removed from the processor whenever a higher-priority process becomes ready to execute.
Non Preemptive: A strategy for time-multiplexing the processor whereby a process does not release the processor until it has completed its work.
First Come First Served: FCFS, also known as First-In-First-Out (FIFO), is the simplest scheduling policy. Arriving jobs are inserted into the tail (rear) of the ready queue and the process to be executed next is removed from the head (front) of the queue.
Shortest Job First : SJF policy selects the job with the shortest (expected) processing time first. Shorter jobs are always executed before long jobs. long running jobs may starve, because the CPU has a steady supply of short jobs.
Round Robin: RR reduces the penalty that short jobs suffer with FCFS by preempting running jobs periodically. The CPU suspends the current job when the reserved quantum (time-slice) is exhausted. The job is then put at the end of the ready queue if not yet completed.
Priority : Each process is assigned a priority. The ready list contains an entry for each process ordered by its priority. The process at the beginning of the list (highest priority) is picked first. A variation of this scheme allows preemption of the current process when a higher priority process arrives.