Multiprogramming,Multiprocessing

Arun I
2 min readJul 30, 2020

Multiprogramming: Consider a process a running in OS it requires two things one is CPU time,I/O time.Suppose if we have process P1,P2,P3 and it is running on single processor. so it starts with the process P1 and after some time of execution of process P1, the process P1 requires some I/O operation. So, it leaves the CPU and starts performing that I/O operation. Now, the CPU will wait for the process P1 to come back for its execution and the CPU will be in an idle state.P2, P3 are waiting for there execution. And at the same time, the CPU will be given to the process P2 and if the process P2 also requires some I/O operation, then the CPU will be given to process P3.This is called Context Switching.

Multiprogramming is a rudimentary form of parallel processing in which several programs are run at the same time on a uniprocessor. Since there is only one processor, there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on.

Multiprocessing:As we know that in a single-processor system, the processor can execute only one process at a time. But when your system is having a lot of work to do and one processor is very less to perform all those work in the required unit of time, then we can use more than one processors in the same system.Suppose, we are having 5 processes P1, P2, P3, P4, and P5. In a uni-processor system, only one process can be executed at a time and after its execution, the next process will be executed and so on. But in a multiprocessor system, the different process can be assigned to different processors and this, in turn, decreases the overall process execution time by the system. A dual-processor system can execute two processes at a time while a quad-processor can execute four processes at a time.

So, two or more processors present in the same computer, sharing the system bus, memory, and other I/O is said to be Multiprocessing System.

--

--