Both Multi-programming and Multi-tasking are related to Operating Systems Concepts
CPU is a super fast device and keeping it occupied for a single task is never a good idea. Considering the huge differences between CPU speed and IO speed, many concepts like multiprogramming, multitasking, multithreading, etc have been introduced to make better CPU utilization.
Multi-programming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute. The idea is to keep multiple jobs in main memory. If one job gets occupied with IO, CPU can be assigned to other job.
Multi-tasking is a logical extension of multiprogramming. In multi-tasking systems, the CPU executes multiple jobs by switching among them typically using a small time quantum, and the switches occur so frequently that the users can interact with each program while it is running.
Difference between Multiprogramming and Multi-tasking
Sr.no Multiprogramming Multi-tasking 1. Both of these concepts are for single CPU. Both of these concepts are for single CPU. 2. Concept of Context Switching is used. Concept of Context Switching and Time Sharing is used. 3. In multiprogrammed system, the operating system simply switches to, and executes, another job when current job needs to wait. The processor is typically used in time sharing mode. Switching happens when either allowed time expires or where there other reason for current process needs to wait (example process needs to do IO). 4. Multi-programming increases CPU utilization by organising jobs . In multi-tasking also increases CPU utilization, it also increases responsiveness. 5. The idea is to reduce the CPU idle time for as long as possible. The idea is to further extend the CPU Utilization concept by increasing responsiveness Time Sharing.
Most of the modern operating systems use Multitasking with more complex setup.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.