To overcome the problem of under utilization of CPU and main memory, the multi-programming was introduced. The multi-programming is interleaved execution of multiple jobs by the same computer.
In multi-programming system, when one program is waiting for I/O transfer; there is another program ready to utilize the CPU. So it is possible for several jobs to share the time of the CPU. But it is important to note that multi-programming is not defined to be the execution of jobs at the same instance of time. Rather it does mean that there are a number of jobs available to the CPU (placed in main memory) and a portion of one is executed then a segment of another and so on. A simple process of multi-programming is shown in figure
As shown in fig, at the particular situation, job’ A’ is not utilizing the CPU time because it is busy in I/ 0 operations. Hence the CPU becomes busy to execute the job ‘B’. Another job C is waiting for the CPU for getting its execution time. So in this state the CPU will never be idle and utilizes maximum of its time.
A program in execution is called a “Process”, “Job” or a “Task”. The concurrent execution of programs improves the utilization of system resources and enhances the system throughput as compared to batch and serial processing. In this system, when a process requests some I/O to allocate; meanwhile the CPU time is assigned to another ready process. So, here when a process is switched to an I/O operation, the CPU is not set idle.
Multi-programming is a common approach to resource management. The essential components of a single-user operating system include a command processor, an input/ output control system, a file system, and a transient area. A multi-programming operating system builds on this base, subdividing the transient area to hold several independent programs and adding resource management routines to the operating system’s basic functions.