In a multi-programming system, several jobs or programs reside in the main memory at any given point of time, while one program is being processed, others wait in the queue, once a process is either completed or goes for I/O or preempted, the processor picks up some other process.
It increases CPU utilization, throughput, and degree of multiprogramming (number of processes at main memory) and enables multi-tasking. Here operating system switching over the CPU service from one process to another.
Non-preemptive:
Here one process gets chance to control of the CPU only when it finishes with its current CPU time.
Example: DOS 3.1.
Preemptive:
Here the running process can be forced to release based on completion of the process or I/O or priority or time quantum.
Example:
Windows, Unix. Transfer of control of the process is called context switching.
Architecture that support multi-programming
(i) Direct Access Memory (DMA):
Process can directly access the memory for I/O operation without CPU intervention with the help of DMA.
(ii) Address Translations:
CPU issues a virtual/logical memory address and Memory Management Unit (MMU) translates it into a physical address to access the memory.
(iii) Two-Mode operation:
CPU working with two different modes to run the processes.