Explain the difference amongst multiprogramming, multitasking, multithreading, and multiprocessing. (8 Marks)

1. Multiprogramming:

Multiprogramming is an operating system capability that allows multiple programs to be loaded into memory and run simultaneously. The CPU switches between the programs to ensure efficient utilization of the system’s resources. However, only one program can execute at a time, while others are waiting for their turn. This technique reduces idle time for the CPU.

2. Multitasking:

Multitasking refers to the ability of an operating system to execute multiple tasks or processes simultaneously. There are two types of multitasking:

  • Preemptive multitasking, where the operating system controls the allocation of CPU time for each process.
  • Cooperative multitasking, where the active task voluntarily gives up control to let other tasks run. Multitasking is common in personal computers and mobile devices.

3. Multithreading:

Multithreading is the ability of a program or an operating system to execute multiple threads (smaller units of a process) concurrently. Threads within the same process share the same memory and resources but run independently. This improves the efficiency of complex applications, such as web servers, which can handle multiple requests at the same time.

4. Multiprocessing:

Multiprocessing involves the use of two or more CPUs (processors) within a single computer system. In this setup, each CPU can execute different processes independently or in parallel. Multiprocessing improves performance and reliability since multiple processors can work on different tasks or divide one task into smaller parts to be executed simultaneously.