Computer Science 440 Spring 2014
Gregory M. Kapfhammer
Operating Systems
Process
Threads
Different?
Similar?
Multiprogramming
Time quantum
10 ms
100 ms
Process = ?
Program
Input
Output
State
When is a process created?
Initialization
Process Spawning
User Request
Batch Job
top
ps
fork
Page 87 - 88
Process Termination?
Normal Exit
Error Exit
Fatal Error
Killed
Process States
Running
Ready
Blocked
Blocking Causes?
Count off by Threes
Threads
java.lang.Thread
Web Server
Figure 2-8
Compare and Contrast
Figure 2-11
Context Switch!
Threads in User Space
Figure 2-16
Single-Threaded to Multi-Threaded
How?
Challenges?
Race Conditions
Mutual Exclusion
Critical Regions
Page 119
Figure 2-22
Producer-Consumer Model
Bounded-Buffer Problem
Synchronized
Semaphores
Binary
Counting
Barriers
Scheduling
Important!
Process Behavior
Compute-bound
I/O-bound
When to Schedule?
Process Creation
Process Exit
Process Block
I/O Interrupt
Clock Interrupt
Non-preemptive
Preemptive
Scheduling Algorithms
Batch
Interactive
Real-time
Figure 2-39
Page 151
Throughput
Turnaround time
Response time
Proportionality
Scheduling Algorithms
Batch
Non-preemptive
FCFS
SJF
Provably Optimal
Simultaneous arrival
Count off by fives
SJF Good?
SJF Bad?
SJF Preemptive?
Interactive
Round-Robin
Priority
Multiple Queues
Policy versus Mechanism
Thread Scheduling
Figure 2-43
Java VM?