Batch Processing vs Multi programming vs Time Sharing

Batch Processing - In batch processing a batches of similar kinds of jobs are made and submitted one by one to the system. From within the batch the jobs are processed one by one. The entire system is used by one process at a time. The sequence of steps is as follows:

1. All users submit the jobs to the operator ( the who who manages the system)

2. The operator selects similar kinds of jobs and makes batches.

3. Job1 from batch 1 is submitted for processing.

4. Job1 uses the CPU and I/O till it is completed. Till this time no other process can use the CPU.

5. After job1 finishes job 2 is loaded into the memory.

 

Go through the below presentation which depicts the working of one of the batch. Note that the CPU time is wasted while the job is doing I/O

Disadvantages of batch processing:


1. Wastage of CPU time
2. No user interaction
3. No mechanism to prioritize processes

Multi-Programming - In multi programming more than one process can reside in the main memory at a time. Thus, when process P1 goes for I/O operation the CPU is not kept waiting and is allocated to some another process (lets say P2). This keeps the CPU busy at all times.

The presentation below shows the working of a multi programming OS

 

Advantages:


1. CPU is being utilized all the time as long as there are more than 1 process
2. The processes can be finished in less amount of time

Disadvantages:


1. No user interaction

 

Time Sharing (multi tasking) - Time sharing overcomes the problem of no user interaction as faced in the above two strategies. Time sharing is the logical extension of multi programing. In time sharing multiple jobs are executes at the same time and the CPU switches among them so frequently that each user can interact with each program while it is running. Time sharing system requires that each user be provided with input device (keyboard or mouse) and an output device (monitor) to interact with the system. This decreases the response time of the system for each user process. This gives each user the illusion that the CPU is working solely for him/her.

The presentation below tries to depict such a situation. Think of the processes from three different users. The CPU shifts between at regular intervals of time. While the CPU is with one of the process, the other users can interact with their process by doing some I/O.

Advantages:


1. User interaction is possible
2. Multi-programming is possible