Scheduling Flashcards
Boot Sequence
(1) CPU loads boot program from ROM, (2) the boot program examines and checks the memory configuration, builds a configuration structure describing the hardware, loads the OS kernel and gives it the configuration structure, (3) initializes OS
Initializing the OS
(1) initialize kernel structures, (2) initialize the state of all hardware devices, (3) creates a number of processes to start operation. (4) if there are user programs, those are run, else it enters the idle loop
OS wakes up from…
Interrupts, exception, and system calls (traps)
Multiprogramming / Concurrency
One process running while one or more on I/O to increase system utilization and throughput
Context Switch
Changing from one process to another
What are the steps of a context switch?
(1) Process is running, (2) Process is blocked or interrupted, (3) Switch to kernel, (4) OS saves process state to PCB, (5) OS chooses new process to run, (6) OS loads its state from PCB, (7) Process is running
When does the kernel run the scheduler?
A process switches from running to blocked, a process is created or terminated. an interrupt occurs
Non-preemptive System
Scheduler runs when a process is blocked, not because of an interrupt
Preemptive System
OS makes scheduling decisions during interrupts, but requires interrupt to give control back to OS
Throughput
number of processes completed during a unit of time
Turnaround Time
length of time to run a process from initialization to termination
CPU utilization
percentage of time that the CPU is busy
Response Time
time between issuing a command and getting a result
Waiting Time
Total amount of time that the process is in the ready queue
What are the 5 criteria for comparing scheduling algorithms?
Throughput, turnaround time, cpu utilization, response time, and waiting time
To maximize throughput you should be…
minimizing overhead and efficiently using the system resources (CPU, I/O)
The Ideal CPU Scheduler
Maximizes CPU utilization and throughput, minimizes response time, waiting time, and turnaround time
Shell
interactive application-level program that runs other programs on behalf of the user. It performs a sequence of read/evaluate steps and then terminates.
Signal
a small message that notifies a process than an event of some type as occurred in the system.
2 reasons a signal is sent
(1) kernel detected a system event or (2) process invoked kill function
Pending Signal
a sent signal that has not yet been received. There can be at most one of these.
Issues with signals
(1) pending signals are blocked, (2) pending signals are not queued, (3) system calls can be interrupted
Nonlocal jumps
user level control that transfers control directly from one function to another. Allows for immediate return from a deeply nested function call. (setjmp will save current environment before jumping)
Selecting a time slice for round robin
- too small: throughput suffers because too much time is spent on context switching
- too big: waiting time suffers and it degenerates to FCFS