Types of Operating Systems
Every operating system optimizes something. Batch systems optimize throughput, time-sharing systems optimize response, and real-time systems optimize determinism.
In plain English
Batch, time-sharing, and real-time systems are different schedules for the same school day.
By the end you will be able to
- Compare batch, multiprogramming, time-sharing, and real-time systems.
- Explain the trade-off between throughput and response time.
- Recognize which OS type fits a given workload.
Batch systems
A batch system runs jobs in groups without interactive input. A job is submitted, queued, executed, and its output is collected later. Batch systems maximize throughput and minimize operator intervention, but a job cannot ask questions or react to a user. Early mainframes used this model, and modern batch schedulers still use the same idea for large data jobs.
Multiprogramming and time-sharing
Multiprogramming keeps several jobs in memory so the CPU has work when one job waits for I/O. Time-sharing goes further: it switches rapidly between users or processes, giving each a small slice of CPU time. The result feels interactive even though the CPU is shared. The cost is context-switch overhead and the need for memory protection.
/* time-sharing illusion */
while (system running) {
run(process, quantum);
save_context(process);
process = choose_next();
restore_context(process);
}Real-time systems
A real-time system must meet deadlines. A hard real-time system missing a deadline can be catastrophic; a soft real-time system degrades quality but continues. Real-time schedulers prioritize predictability over average throughput. They may use priority inheritance, bounded interrupt latency, and fixed-cycle execution to make the worst case analyzable.
Key takeaways
- Batch systems optimize throughput, not interactivity.
- Multiprogramming keeps the CPU busy during I/O waits.
- Time-sharing optimizes response time by rapid switching.
- Real-time systems optimize deadline determinism.
Common pitfalls
- Assuming faster average performance means a better real-time system.
- Confusing multiprogramming with multiprocessing.
- Thinking time-sharing means true simultaneous execution on one CPU.
Kernel notes
- Match each OS type to its primary metric.
- Explain why time-sharing needs a timer interrupt.
- Know the difference between hard and soft real-time.
Quick check
1. Which OS type primarily optimizes interactive response time?
2. What is the main goal of a hard real-time system?