- the processor (or cpu)
- keep it busy - an idle processor is a waste
- keep it fair (for various definitions of fair) - predictable behavior
- this almost always involves sharing - unless you've got a lot of cpus
- job scheduling and process scheduling
- job scheduling - what to admit; the admissions policy
- process scheduling - what to run next
- also, recovery from poor decisions - what to punt
- this can be recursive - scheduling multiprocessors
- programs, processes, and threads
- program - computation to perform
- process - the resources needed to perform a computation
- thread - the processor abstraction
- processes
- a bag of resources needed for a computation - except for the cpu
- implementing resources
- the resource managers create resource abstractions for processes
- not all resources can be allocated at process create time
- resource managers coordinate with other resource managers and the
process manager - files use disk and memory; not enough memory
suspends the process
- process address spaces - where process resources are stored; only the
address space is accessible; code and data reside in the address space
- creation - compilation (
.o
) to linking (.o
and .a
) to
loading (a.out
)
- process loading - reading in the executable, starting execution
- address space consistency
- there are many memories - registers, cache, primary, secondary
- to improve performance, parts process state may be copied
- changing state while keeping all copies the same - the consistency
problem
- process control blocks - the actual bag
- identification, status, state, accounting
- frequently shifted from queue to queue within the os
- the process state and transitions
- where is the process now? where can it go next? how?
- states - running, waiting, blocked
- state diagram - indicates the transitions between states, and how
- process scheduling policies
- objectives - throughput, response time, turnaround time, waiting,
utilization, fairness
- two tasks - when to swap out, what to swap in
- when to swap out - pre-emptive or non preemptive
- pre-emption - on natural boundries, on a time slice, or external
factors
- non-pre-emptive - process cedes the cpu, or exits
- what to swap in - it's all priority scheduling
- fcfs, sjn, round robin, srt next, priority scheduling
- implementation - when one is not enough
- multi-level queues - implement different policies or different
versions of the same policy
This page last modified on 23 September 2002.