Program, Process, and Thread

1024px-punched_card_program_deck.agr_

Source: Wikipedia

  • A program refers to the image persisted in the storage or at rest (e.g. punch cards). It can be a text-based script (DOS batch file, Windows Powershell script, bash shell script, JavaScript, etc.) or binary-based executable (.exe or legacy .com).
  • A process refers to the code and data in memory segments into which the operating system loads a program. Simply put, a process is a program that is loaded into the memory to be executed by the processor.
  • A thread is the minimum execution unit of code managed by the operating system. In a modern operating system, a process can be divided into threads. Even on a single processor system, threads can be switched between time slots to support preemptive multitasking.

Multi-programming (one by one)

Multi-programming, typically on a uni-processor system, is a capability of the operating system that is capable of loading multiple programs into the main memory to be executed. As this is a legacy feature, multiple programs can be loaded into memory, but the processor can execute only one process at a time. Image the early days when computer operators feed and load programs in punch cards into the main memory of a computer system; multi-programming is an achievement.

Multi-tasking

The definition of a task or job varies. Some also call a process as a task or job. In Windows, a job is a group of processes, while a task is a thread-based construct that supports both asynchronous (futures or callbacks) and parallel processing.

Multi-tasking is the capacity of concurrency, that is, doing more than one thing at a time. Concurrency can be perceivable experience (preemptive or cooperative multi-tasking) or parallel real-time executions (multi-processing).

Multi-threading is a multi-tasking implementation that supports fast switching between threads so that users can perceive multiple tasks or applications performed “at the same time” on a uni-processor system. It’s even more powerful on a multi-processor system.

Multi-processing is the multi-tasking capability fulfilled through a multi-processor system.

  • Symmetric multiprocessing (SMP): multiple processors controlled by a single operating system.
  • Massively parallel processing (MPP): a collection of multi-processor systems with its own operating system works as a unit.

Leave a Reply