Lecture Notes for Operating Systems

Processes, 20 September 2000


  1. programs

    1. a program has code and (internal) data

    2. a program needs external data too - input or output

    3. an executing program scarfs up resources - memory, screen real estate

  2. processes

    1. basic execution unit - single unit or multiple units (threads)

    2. program + execution state

      1. hardware - registers; psw, pc, segment...

      2. software - os resources; open children,

  3. process execution

    1. stand-alone - one process, one machine; real-time, embedded systems

    2. batch - sequential, independent processes

      1. inefficient utilization - idle cpu, storage, devices

    3. multiprogramming - parallel, independent processes

    4. multiprocessing - parallel, quasi-coordinated processes; ipc

    5. multiprocessors - more than one cpu; SMP

  4. operating system's job

    1. implement the process abstraction - process tables

    2. select processes for execution - scheduling

    3. move processes in and out of execution - context swapping

    4. handle requests - system calls, resource management

  5. the process abstraction

    1. code to execute - text, data (initialized and uninitialized)

    2. priority - how this process relates to other processes

    3. resources - files, storage (dynamic and segments), devices

    4. parents and children

      1. fork system call

      2. relation among parents and children - resource sharing, communication

    5. process state - ready, running, blocked

    6. permissions (capabilities) - what can the process do

  6. the process table

    1. a large, hairy data-structure stored in the operating system

    2. shuffled around queues - ready, blocked, and so on.

    3. static or dynamic - swappable os; process-table attacks.

  7. threads

    1. light-weight processes - less execution state; fast context switches.

    2. run in the host process - share resources with the host and other threads.

    3. operating system support

      1. none - roll your own with regular (sort of) control transfers and assembly-level register manipulation; non-pre-emptive

      2. some - thread-friendly (multi-threaded) libraries and system calls.

      3. full - operating-system threads, either accessed directly or (more usually) mapped into process threads; also used to implement the operating system.

    4. examples - posix threads, p-threads; solaris threads (k-threads, light-weight processes, user threads); NT threads.

    5. should you program in threads - maybe, maybe not; john ousterhout has an opinion on this question.


This page last modified on 20 September 2000.