Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 66 ยท Getting Started

Types of Operating Systems

Compare batch, multiprogramming, time-sharing, multiprocessing, distributed, real-time and embedded operating systems, and see why multiprogramming raises CPU use.

Not every operating system tries to do the same job. The OS on a thermostat, the OS on a bank's mainframe and the OS on your phone all manage resources, but they optimize for different things. Historically, the types of operating systems follow the history of computers: each new type appeared to fix a weakness of the previous one.

In this lesson you will walk through the main types, learn the difference between multiprogramming, multitasking and multiprocessing (three words that are constantly confused), and run a small simulation that shows why multiprogramming was such a big step forward.

A short family tree

Batch Run jobs one after another.
Multiprogramming Keep several jobs in memory.
Time-sharing Switch fast so users feel alone.

Each step kept the CPU busier and users happier.

1 / 2

Batch operating systems

Early computers were enormous and expensive. Programmers handed a deck of punched cards to an operator, who grouped similar jobs into a batch and ran them one after another with no interaction. The OS (a small resident monitor) simply loaded the next job when the previous one finished.

The weakness: the CPU sat idle whenever a job waited for a slow device such as a card reader or tape. Results came back hours later, and a bug in one job meant waiting for the next batch. Batch processing is not dead, though. Nightly payroll runs, billing and large data jobs are still "batch jobs".

Multiprogramming

Multiprogramming keeps several jobs in memory at once. When the running job has to wait for I/O, the OS gives the CPU to another job instead of leaving it idle. The goal is CPU utilization: the fraction of time the CPU does useful work.

The simulation below gives every job a pattern of "compute for 2 ticks, then wait for I/O for 6 ticks", four times. First it runs jobs strictly one at a time (batch), then lets idle time be filled by other jobs (multiprogramming).

Python Why multiprogramming helps

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see the batch run finish much later with low utilization (the CPU is busy only 25% of the time), while the multiprogrammed run overlaps one job's waiting with another job's computing. The more jobs you keep in memory (the degree of multiprogramming), the better the utilization, until memory runs out.

Multitasking and time-sharing

Multiprogramming switches only when a job blocks. A job that never waits could hog the CPU. Multitasking, also called time-sharing, adds a timer: each job gets a short time slice (a few milliseconds), then the OS forcibly switches to the next. Switching happens so often that every user (or every window) feels as if they own the machine. This gives fast response time, which matters for interactive use.

Python Time slices in action

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

This is the idea behind round-robin scheduling.

Multiprocessing (multiprocessor systems)

Multiprocessing means more than one CPU or core executing at the same instant. It is about hardware, while multiprogramming and multitasking are about how the OS shares one CPU. Modern systems use all three: many programs in memory (multiprogramming), time slices (multitasking) and several cores (multiprocessing). Most are symmetric multiprocessing (SMP): every core is equal and runs the same OS. See multiprocessor scheduling.

Term One-line meaning
Multiprogramming Several programs in memory; switch when one waits
Multitasking / time-sharing Switch on a timer for fast response
Multiprocessing Several CPUs or cores run truly in parallel
Multithreading Several threads inside one process (threads)

Real-time operating systems

A real-time operating system (RTOS) must respond within a deadline. Correctness depends on when the answer arrives, not just on the answer. A hard real-time system treats a missed deadline as a failure (airbag controllers, pacemakers, flight control). A soft real-time system tolerates occasional misses with degraded quality (video playback, online games). An RTOS values predictability over raw throughput.

Distributed, network, embedded and mobile systems

  • Distributed OS: several independent computers cooperate and appear as one system, sharing load and resources. Clusters and cloud platforms use these ideas (distributed systems).
  • Network OS: each machine runs its own OS but offers file and printer sharing over a network.
  • Embedded OS: a small, fixed-purpose OS inside a washing machine, router or car part, with tight memory limits.
  • Mobile OS: Android and iOS add power management, touch, sensors and app sandboxes.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main goal of multiprogramming?

    While one job waits for slow I/O, the OS gives the CPU to another job in memory, raising CPU utilization.
  2. 2. Which feature distinguishes time-sharing from plain multiprogramming?

    Time-sharing adds timer-driven preemption, which gives quick response times to interactive users.
  3. 3. A car airbag controller needs which kind of OS?

    Missing the deadline would be a failure, so it needs hard real-time guarantees.
  4. 4. Which term refers to hardware with several cores executing at the same instant?

    Multiprocessing is about multiple processors. Multiprogramming and multitasking are ways of sharing a CPU.

Summary

  • Batch systems ran one job at a time; multiprogramming overlaps I/O waits with other jobs to raise CPU utilization.
  • Time-sharing (multitasking) adds a timer and time slices for good response time.
  • Multiprocessing means several CPUs or cores; multithreading means several threads in one process.
  • Real-time systems are judged by meeting deadlines (hard or soft).
  • Distributed, network, embedded and mobile systems specialize the same ideas.

Next: Kernel and System Calls