Skip to main content

Types of Operating Systems

Operating systems (OS) come in various types, each designed to meet specific needs and scenarios. Choosing the right OS depends on factors such as maximum CPU utilization, process starvation prevention, and prioritization of high-priority tasks.

Batch Processing OS​

Batch Processing OS

Batch Processing OS

Early computers operated in a non-interactive way. In a Batch Processing OS, users would submit all inputs required for a task in one go—called a job. These jobs were collected and processed in batches by the OS.

  • Punch Cards: Users used punch cards to store digital data (0s and 1s). Once prepared, these cards were handed to an operator who would group similar jobs into batches.

  • Efficiency: The main advantage was minimizing the time spent on allocating and deallocating memory for each job, as batches were processed one at a time.

  • Drawbacks: Maximum CPU utilization wasn't achieved because if one job was waiting for an I/O operation (like printing), others would have to wait. Process starvation was possible if jobs were prioritized poorly.

Multi-Programming OS​

Multi Programming OS

Multi Programming OS

A Multi-Programming OS introduces the concept of a ready queue where multiple processes wait their turn to use the CPU. The OS switches between processes to keep the CPU busy.

  • How It Works: Processes like P1, P2, and P3 are lined up. If P1 needs an I/O operation, it moves to a waiting state, and P2 gets the CPU. This switching keeps the CPU utilization high.

  • Drawbacks: While it improves CPU utilization, process starvation can still occur if one process takes too long. High-priority processes might need to wait for their turn unless there's a preemption mechanism.

Multi-Tasking OS​

Multi Tasking OS

Multi Tasking OS

Multi-Tasking OS is a step further. It not only allows multiple processes but ensures that each gets a fair share of the CPU time through time-sharing.

  • Time Quantum: Each process runs for a specific time slice (e.g., 100 ms). If a process doesn’t finish within its slice, it’s paused, and the next process starts, preventing any single process from hogging the CPU.

  • User Experience: This rapid switching is so fast that it appears to users as if multiple processes are running simultaneously.

Note

Each process gets a brief context switch, making users feel like multiple applications are running at once.

Multi-Processing OS​

Multi Processing OS

Multi Processing OS

In a Multi-Processing OS, we introduce more than one CPU, which allows real parallel execution of processes.

  • Multiple CPUs: Unlike multi-tasking, which gives the illusion of simultaneous processing, multi-processing truly runs multiple processes simultaneously because there are multiple processors.

  • Advantages: This leads to even better CPU utilization, reduced response time, and the capability to handle more demanding applications efficiently.

Distributed OS​

Distributed OS

Distributed OS

A Distributed OS manages a group of distinct computers and makes them appear as a single computer. Each machine has its own CPU, RAM, etc., and tasks are distributed among them.

  • How It Works: Instead of one machine doing all the work, tasks are spread across multiple systems. This increases efficiency and reliability because if one machine fails, others can take over its tasks.

  • Use Case: This is common in environments where managing everything on a single computer would be overwhelming, such as cloud computing and large-scale applications.

Real-Time OS​

Real-Time Operating Systems (RTOS) are designed to handle tasks with strict timing constraints. They are commonly used in scenarios where precise timing and predictability are critical.

Hard Real-Time OS​

In hard real-time systems, tasks must meet their deadlines. Missing a deadline can lead to catastrophic failures.

Example: In a car’s airbag deployment system, sensors must detect a crash and deploy the airbag within milliseconds. Failing to meet this deadline could result in severe injury or even death.

Soft Real-Time OS​

Soft real-time systems have less stringent timing constraints. Missing a deadline occasionally is acceptable, though it might degrade performance.

Example: A video streaming service needs to deliver frames in a timely manner for a smooth viewing experience. Occasional delays may cause buffering but aren’t catastrophic.