Process Anatomy


  • Code at rest: Program
  • Code in execution: Process

Process memory layout

Process State

  • New
  • Ready
  • Running
  • Termination
  • Waiting
  • Suspended wait
  • Suspended ready
  • CPU bound
  • IO-bound

OS Ready Queue

Process Control Block

  • Process ID: Unique ID of the process
  • Process State: State of the process which we discussed above.
  • Program Counter: PC is a register that stores the address of the instruction that will be expected next.
  • CPU registers: There is a mismatch in the speed of the CPU and RAM. If we load data directly from the main memory then the CPU will be idle for a significant amount of time. Hence data is loaded into the registers. PCB points to the registers used by the process during its execution.
  • CPU scheduling information
  • Memory Management Information
  • I/O status information

CPU scheduling

  • First come first serve (FCFS)
  • Shortest Job First (SJF)
  • Shortest Remaining Time First ( SJF + Preemption)
  • Longest Job First (LJF)
  • Longest Remaining Time First ( LJF + Preemption)
  • Round Robin ( FCFS + Preemption based on time quantum)

Context Switching



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store