Types of Operating Systems: Batch, Multiprogramming, Multiprocessing & Time-Sharing
1. Overview of Operating System Types
Operating systems are classified based on how they manage the CPU, how many users they support simultaneously, and how quickly they respond to user inputs. In this section, we cover the first four foundational types of OS in your DAVV syllabus:
- Batch Operating System
- Multiprogramming Operating System
- Multiprocessing Operating System
- Time-Sharing (Multitasking) Operating System
2. Batch Operating System
In a Batch Operating System (popular in 1950s–60s mainframes), the user does not interact directly with the computer while their program is running.
How It Works:
- Each user prepares their job (Program + Input Data + Control Instructions) offline and hands it over to a human Computer Operator.
- To avoid wasting time loading and unloading compilers repeatedly, the Operator groups jobs with similar requirements (e.g., all FORTRAN jobs together, all COBOL jobs together) into a Batch.
- The Batch OS executes jobs in the batch one after another sequentially without any human intervention.
Advantages:
- Eliminates idle setup time between consecutive jobs.
- Multiple users can share an expensive mainframe computer.
Disadvantages:
- CPU Starvation / Idle Time: Whenever the current job waits for slow I/O (printer or tape), the CPU sits completely idle!
- Zero Interactive Debugging: If there is a small syntax error on line 5, the user only finds out the next day when the printed output is returned.
Real-World Examples Today:
- Monthly Bank Statement generation, Electricity/Telephone Bill processing, and Payroll calculation systems still run as automated night batch jobs!
3. Multiprogramming Operating System
Why was Multiprogramming invented? In a Batch system, a single job cannot keep both the CPU and I/O devices busy at all times. Since I/O devices are thousands of times slower than the CPU, the CPU spends most of its time sitting idle waiting for I/O!
Multiprogramming solves this by keeping several jobs (programs) in Main Memory (RAM) simultaneously!
How It Works:
- The OS picks Job 1 from RAM and starts executing it on the CPU.
- As soon as Job 1 needs to wait for an I/O operation (like reading a file from disk), the OS does NOT wait—it immediately switches the CPU to Job 2 (which is already waiting in RAM)!
- When Job 2 needs I/O, the CPU switches to Job 3, and so on.
- Core Goal of Multiprogramming: Maximize CPU Utilization (never let the CPU sit idle as long as at least one job is ready to run!).
4. Time-Sharing (Multitasking) Operating System
A Time-Sharing Operating System is a logical extension of Multiprogramming.
- In normal Multiprogramming, the CPU only switches from Job 1 to Job 2 when Job 1 voluntarily asks for I/O. What if Job 1 is doing heavy math for 2 hours without any I/O? All other users would freeze!
- In a Time-Sharing OS, the CPU switches between multiple running jobs so rapidly (every few milliseconds) using a fixed time slice called a Time Quantum (or Time Slice) that every user feels like they have the entire computer to themselves!
Analogy: A Chess Grandmaster playing against 10 opponents simultaneously—walking around the table and making a move on each board every 5 seconds. Each player feels like they are playing a live one-on-one match!
Key Features of Time-Sharing OS:
- Interactive Computing: Users interact directly with their running program via keyboard/mouse and get an immediate response.
- Time Slice / Quantum: Each process gets a small fixed burst of CPU time (e.g.,
10 msto100 ms). If it hasn’t finished when the timer expires, it is preempted and moved to the back of the queue (Round-Robin Scheduling). - Core Goal of Time-Sharing: Minimize Response Time for interactive users.
- Examples: UNIX, Linux, Windows, macOS.
5. Multiprocessing Operating System (Parallel Systems)
While Multiprogramming and Time-Sharing use a single CPU switching rapidly between tasks, a Multiprocessing Operating System uses two or more physical CPUs (or Multi-Core Processors) connected to the same computer system, sharing the system bus, clock, and RAM!
- Follows a Master-Slave relationship
- One Master CPU runs the OS and assigns tasks to Slave CPUs
- Simple to design, but if Master CPU fails, system halts
- All CPUs are Equal Peers (No Master-Slave)
- Every CPU runs its own copy/threads of the OS and picks tasks from a shared queue
- Used in all modern Quad-Core / Octa-Core PCs & Servers!
3 Major Advantages of Multiprocessing Systems:
- Increased Throughput: With N processors working truly in parallel at the exact same instant, more work gets done in less time.
- Economy of Scale: Cheaper than buying N separate computers because all CPUs share the same power supply, RAM, and hard disks.
- Increased Reliability (Graceful Degradation / Fault Tolerance): If one processor fails in a 4-CPU system, the system does not crash—the remaining 3 CPUs take over its work and run at 75% speed!
6. Master Comparison: Multiprogramming vs Time-Sharing vs Multiprocessing
This comparison table is a must-write for 8-mark questions in DAVV BCA exams!
| Basis | Multiprogramming OS | Time-Sharing (Multitasking) OS | Multiprocessing OS |
|---|---|---|---|
| 1. Number of CPUs | 1 CPU (Single processor). | 1 CPU (Single processor). | 2 or more CPUs (Multiple processors/cores). |
| 2. Primary Objective | Maximize CPU Utilization (keep CPU busy when I/O occurs). | Minimize Response Time (give fast interactive feedback to users). | Maximize Throughput & Reliability via true parallel execution. |
| 3. When Does CPU Switch? | Switches only when the current process waits for I/O (Non-preemptive). | Switches every few milliseconds when the Time Quantum expires (Preemptive). | Multiple processes execute at the exact same instant on separate CPUs. |
| 4. Execution Type | Concurrent (Interleaved). | Concurrent (Time-Sliced). | True Parallel Execution. |
💡 Exam Preparation Tips for DAVV BCA
- Never confuse Multiprogramming (multiple programs in RAM on 1 CPU) with Multiprocessing (multiple CPUs/Processors in hardware).
- Remember the two golden goals:
- Multiprogramming Goal: Maximize CPU Utilization.
- Time-Sharing Goal: Minimize Response Time.