Saturday, February 19, 2011

OS- MULTIPROGRAMMING

Multiprogramming is one of the more basic types of parallel processing that can be employed in many different environments. Essentially, multiprogramming makes it possible for several programs to be active at the same time, while still running through a single processor.

Multiprogramming is very different from the multiprocessing because even though there may be several programs currently active, the uniprocessor is not simultaneously executing commands for all the programs. Instead, the processor addresses each program, executes a single command, then moves on to the next program in the queue. The previous program remains active, but enters into a passive state until the uniprocessor returns to the front of the queue and executes a second command. 

Multiprogramming is the rapid switching of the CPU between multiple processes in memory. It is done only when the currently running process requests I/O, or terminates. It was commonly used to keep the CPU busy while one or more processes are doing I/O. It is now mostly
 super ceded by multitasking, in which processes also lose the CPU when their time quantum expires.
Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users. It attempts to increase CPU utilization by always having something for the CPU to execute.
The prime reason for multiprogramming is to give the CPU something to do while waiting for I/O to complete. If there is no DMA, the CPU is fully occupied doing I/O, so there is nothing to be gained (at least in terms of CPU utilization) by multiprogramming. No matter how much I/O a program does, the CPU will be 100% busy. This of course assumes the major delay
is the wait while data is copied. A CPU could do other work if the I/O were slow for other reasons (arriving on a serial line, for instance).

No comments:

Post a Comment