Lecture Notes for Operating Systems
Processes, 13 September 1999
These are provisional lecture notes, expect changes.
- processes
- basic execution unit - almost atomic (threads)
- program + execution state
- hardware - registers; psw, pc, segment...
- software - os resources; open children,
- process execution
- stand-alone - one process, one machine; real-time, embedded systems
- batch - sequential, independent processes
- inefficient utilization - idle cpu, storage, devices
- multiprogramming - parallel, independent processes
- multiprocessing - parallel, quasi-coordinated processes; ipc
- multiprocessors - more than one cpu; SMP
- operating system's job
- implement the process abstraction - process tables
- select processes for execution - scheduling
- move processes in and out of execution - context swapping
- handle requests - system calls, resource management
- the process abstraction
- code to execute - text, data (initialized and uninitialized)
- priority - how this process relates to other processes
- resources - files, storage (dynamic and segments), devices
- parents and children
- fork system call
- relation among parents and children - resource sharing,
communication
- process state - ready, running, blocked
- permissions (capabilities) - what can the process do
- the process table
- a large, hairy data-structure stored in the operating system
- shuffled around queues - ready, blocked, and so on.
- static or dynamic - swappable os; process-table attacks.
- threads
- light-weight processes - less execution state; fast context switches.
- run in the host process - share resources with the host and other
threads.
- operating system support
- none - roll your own with regular (sort of) control transfers and
assembly-level register manipulation; non-pre-emptive
- some - thread-friendly (multi-threaded) libraries and system calls.
- full - operating-system threads, either accessed directly or (more
usually) mapped into process threads; also used to implement the
operating system.
- examples - posix threads, p-threads;
solaris threads (k-threads, light-weight processes, user threads);
NT threads.
- should you program in threads - maybe, maybe not; john ousterhout has
an
opinion on this question.
This page last modified on 20 September 1999.