This preview shows page 1. Sign up to view the full content.
Unformatted text preview: dle.
The CPU switches from one program to another almost instantaneously. Thus in
multiprogramming several user programs share the time of the CPU to kept it
It is important to note here that multiprogramming is not defined to be the
execution of instructions from several programs simultaneously. Rather, it does
mean that there are a number of programs available to the CPU (stored in the main
memory) and that a portion of one is executed, then a segment of another, and so
on. Although two or more user programs reside in the main memory
simultaneously, the CPU is capable of executing only one instruction at a time.
Hence at any given time, only one of the programs has control of the CPU and is executing instructions. Simultaneous execution of more than one program with a
single CPU is impossible. In some multiprogramming systems, only a fixed
number of jobs can be processed concurrently (multiprogramming with fixed
tasks) (MFT), while in others the number of jobs can vary (multiprogramming
with variable tasks) (MVT).
A typical scenario of jobs in a multiprogramming system is shown in Figure 14.4.
At the particular time instance shown in the figure, job A is not utilizing the CPU
since it is busy writing output data on to the disk (I/O operations). Hence the CPU
is being utilized to execute job B, which is also present in the main memory. Job
C, also residing in the main memory, is waiting for the CPU to become free.
Actually, as shown in Figure 14.5, in case of multiprogramming all the jobs
residing in the main memory will be in one of the following three states -running
(it is using the CPU), blocked (it is performing I/O operations) and ready (it is
waiting for CPU to be assigned to it). In our example, jobs A, B and C are in
blocked, running and ready states respectively. Since job C is in the ready state, as
soon as the execution of job B is completed or job B requires doing I/O operation,
the CPU will start executing job C. In the meanwhile, if job A complet...
View Full Document
- Spring '14