A batch process performs a long-running and generally repetitive task that does not require any intervention from the user. Ex: Payroll, insurance claims processing, weather prediction, scientific calculations.
These are typically run on a server and not a desktop user machine.
The FIFO (First-In-First-Out) algorithm, also known as FCFS (First-Come-First-Serve), schedules processes strictly according to the process arrival time. The earlier the arrival, the higher the priority.
In practice, all requests are processed sequentially and thus all processes have different arrival times. The type of data structure for this is a Queue.
The SJF (Shortest Job First) algorithm, also known as SJN (Shortest Job Next), schedules processes according to the total CPU time requirements. The shorter the required CPU time, the higher the priority. This requires the system know how long a job should take. In many cases with a batch job it might – running payroll, sending accounting notices, running a weather simulation to determine a forecast should take about the same amount of time from day to day/ week to week. Unless a new algorithm is used, more data needs to be processed, etc.
The SRT (Shortest Remaining Time) algorithm schedules processes according to the remaining CPU time needed to complete the work. The shorter the remaining CPU time, the higher the priority. This requires the OS to know how long a process is expected to run, and how long it has been running.
This allows for long jobs to be interrupted, so that other jobs may finish first. The idea being that you don’t get bound behind a long job which may take hours or even days to potentially run – like a year end accounting update, calculating and sending all W2s, etc.
Starvation is the indefinite postponement of a process while other processes are allowed to proceed. Both SJF and SRT can lead to starvation.
Scheduling of Batch Processes was originally found on Access 2 Learn