Name: _______________________________
CS 1550 – Quiz 1
Please answer the following questions. You have 25 minutes to complete this quiz. (50 points)
1.) (10 points) List two things that would be part of a process table entry (PTE) but not a thread table entry.
Address space
Open files
Child processes
Signals & handlers
Accounting info
Global variables
2.) (10 points) What is the difference between mechanism and policy?
Mechanism
The way something is done (e.g., an algorithm)
Policy
The rules a particular mechanism should follow (i.e., the parameters of an algorithm)
3.) (20 points) List an advantage and a disadvantage of both User Threads and a Kernel threads.
|
User Threading |
Kernel Threading |
Advantage |
- Faster in theory to create - Don’t need explicit OS support - Can schedule with a different algo than the OS uses |
- Don’t need to do explicit yielding (OS takes care of preemption) - May be fast in practice if good implementation
|
Disadvantage |
- Must yield, no reliable mechanism for preemption - Must use nonblocking I/O calls otherwise whole process blocks |
- in theory slower to create and manage due to system calls - Must use system-wide scheduling algorithm |
4.) (10 points) Under Shortest Job First, if the following jobs (with indicated processing times) arrived at time zero, what would be the Average Turnaround Time and the Throughput? Show your work.
A (6) |
B (4) |
C (10) |
D (8) |
E (2) |
Schedule is EBADC
Throughput is 5 jobs in 30 time units or 1/6
Turnaround time:
E: 2 – 0 = 2
B: 6-0=6
A: 12-0=12
D: 20-0=20
C: 30-0=30
Average Turnaround Time: 2+6+12+20+30 = 70/5