processes

Complete

Summary

Process contexts

Memory contextHardware contextOS context
- code/machine code
- data
- stack
- heap
- registers
- program counter
- return PC
- stack pointer
- frame pointer
- process properties
- resources used
- pid
- process state

Concept

Process abstraction

  • dynamic abstraction for a executing programs
  • stores information required to describe the running program

Memory regions

RegionContents
text- instructions/code
data- global variables
- filled at compile time
stack- local variables during function execution
- allocated during call, deallocated on return
heap- dynamic data
- allocated at any point during runtime

5 state process model

  • create: spawn new process
  • admit: process becomes ready to run
  • switch(scheduled): process is selected to be run
  • switch(release): process gives up CPU, either voluntarily or by scheduler
  • event wait: process requests service that is unavailable or in progress, ie. I/O, user input, network request
  • event occurs: request is fulfilled and process can continue

5-state_model.png

Queuing model

  • global view from the OS’s perspective
  • 1 CPU can only run <= 1 process at a time

queuing-model.png

Process control block(PCB)

  • entry in the process table
  • contains the whole context required to describe one process