cs330

Cards (12)

  • Process
    A program in execution; process execution must progress in sequential fashion. No parallel execution of instructions of a single process
  • Process
    • Program code (text section)
    • Current activity including program counter, processor registers
    • Stack containing temporary data, function parameters, return addresses, local variables
    • Data section containing global variables
    • Heap containing memory dynamically allocated during run time
  • Program
    Passive entity stored on disk (executable file); process is active
  • Process Execution
    1. Program becomes process when an executable file is loaded into memory
    2. Execution of program started via GUI mouse clicks, command line entry of its name, etc.
    3. One program can be several processes
    4. Consider multiple users executing the same program
  • Process State
    • New: The process is being created
    • Running: Instructions are being executed
    • Waiting: The process is waiting for some event to occur
    • Ready: The process is waiting to be assigned to a processor
    • Terminated: The process has finished execution
  • Process Control Block (PCB)

    • Process state
    • Program counter
    • CPU registers
    • CPU scheduling information
    • Memory-management information
    • Accounting information
    • I/O status information
  • The PCB is constructed at process creation
  • The PCB includes a pointer to be used in lists (queues) of PCBs
  • The PCB is used to save information about a process when switched out of CPU
  • Threads
    • Multiple program counters per process
    • Multiple locations can execute at once
    • Multiple threads of control
  • Process Scheduler
    • Selects among available processes for next execution on CPU core
    • Goal is to maximize CPU use and quickly switch processes onto CPU core
    • Maintains scheduling queues of processes
  • Scheduling Queues
    • Ready queue - set of all processes residing in main memory, ready and waiting to execute
    • Wait queues - set of processes waiting for an event (i.e., I/O)