Figure 4.12 (adapted from Madnick and Donovan, 1974) is a
simplified process model of you, in which there are only two states: sleeping
and waking. You make the transistion from waking to sleeping when you are
tired, and from sleeping to waking when alarm clock goes off.
|
|
|
a. Add
three more states to the diagram (for example, one might be eating).
Answer:
b. State
all of the possible transitions among the five states.
Answer:
-
SUSPEND BLOCKED then BLOCKED → If a process in
the RUNNING state requires more memory, then at least
one BLOCKED process can be swapped out of memory onto disk.
The transition can also be made for the BLOCKED process if
there are READY processes available, and the OS determines
that the READY process that it would like to dispatch requires
more main memory to maintain adequate performance.
-
SUSPEND BLOCKED then SUSPEND READY A process in
the SUSPEND BLOCKED state is moved to the SUSPEND
READY state when the event for which it has been waiting occurs. Note
that this requires that the state information concerning suspended processes be
accessible to the OS.
-
SUSPEND READY then READY When there are
no READY processes in main hbbbbbmemory, the OS will need to
bring one in to continue execution. In addition, it might be the case that a
process in the READY SUSPEND state has higher priority than
any of the processes in the READY state. In that case, the OS designer
may dictate that it is more important to get at the higher priority process
than to minimise swapping.
-
SUSPENDED but READY Normally, the OS would be
designed so that the preference would be to suspend a BLOCKED process
rather than a READY one.
No comments:
Post a Comment