Академический Документы
Профессиональный Документы
Культура Документы
Chapter 4
1. Figure 4.12 is a simplified process model of you, in which there are only two
states: sleeping and waking. You make the transition from waking to sleeping
when you are tired, and from sleeping to waking when the alarm clock goes off.
a. Add three more states to the diagram (for example, one might be eating).
2. Describe context switching in lay terms and identify the process information
that needs to be saved, changed, or updated when context switching takes place.
A
D
E
B
C
4. A job running in a system, with variable time quantums per queue, needs 30
milliseconds to run to completion. If the first queue has a time quantum of 5
milliseconds and each queue thereafter has a time quantum that is twice as large
as the previous one, how many times will the job be interrupted and on which
queue will it finish its execution?
The job will be interrupted twice, and will finish on the 20 millisecond queue.
5. Describe the advantages of having a separate queue for Print I/O and for Disk
I/O as illustrated in Figure 4.4
Flexibility
JOBS D A G C F E B
0 1 2 3 4 5 8
12
1+2+3+4+5+8+12/7 = 5.0
1+3+10+12+15/5=8.2
c. SRT
d. Round robin (using a time quantum of 5, ignore context switching and natural wait)
8. Using the same information from Exercise 7, calculate which jobs will have arrived ready for processing by the time the
first job is finished or interrupted using each of the following scheduling algorithms.
a. FCFS
b. SJN
c. SRT
d. Round robin (using a time quantum of 5, ignore context switching and natural wait)