Understanding Process and Thread Management

Sep 5, 2024

Lecture Notes: Process and Thread Management in Operating Systems

Introduction

  • Previous lectures focused on:
    • Introduction to Operating System
    • Operating System Structures
  • Current topic: Process Management

Key Concepts

Programs and Execution

  • Program Development:
    • Written in high-level languages (e.g., C, C++, Java).
    • Must be converted to machine code (binary) for execution.
    • Compiler used to compile programs into machine code.
  • Execution Requirements:
    • The binary executable must be loaded into memory.
    • The Operating System (OS) allocates necessary resources for execution.

Processes

  • Definition:
    • A process is a program in execution.
    • Before execution, a program is a passive entity.
  • Historical Context:
    • Early computers supported only one process at a time.
    • Modern computers support multiple processes simultaneously.
  • Characteristics:
    • A single program can have multiple associated processes.

Threads

  • Definition:
    • A thread is the basic unit of execution within a process.
    • A process can have one or multiple threads.
  • Historical Context:
    • Earlier systems typically had one thread per process.
    • Modern systems allow multiple threads within a single process.

Visualization of Processes and Threads

  • Diagram Explanation:
    • Entirely, a process consists of one or more threads of execution.
    • Each unit of execution is a thread.

Practical Example: Monitoring Processes and Threads

Task Manager (Windows)

  • To view running processes:
    • Open Task Manager.
    • Check the Applications and Processes tabs for active programs and processes.
  • Example:
    • Chromium browser running several processes (e.g., chrome.exe).

Process Explorer

  • Additional tool for detailed analysis:
    • Displays processes and their associated threads.
    • To find threads:
      • Right-click on a process (e.g., chrome.exe) and check properties.
      • View the Threads tab for detailed thread information.

Conclusion

  • Recap of processes and threads:
    • Important to differentiate between the two.
    • Process management is a crucial aspect of operating systems.
  • Upcoming lectures will delve deeper into processes and related topics.