Page 93 - DCAP403_Operating System
P. 93
Operating System
Notes systems. This is the reason why in paged system the pager process is usually run at a very high
(dispatching) priority level.
Figure 5.9: Medium term Scheduling
Terminate
Running
(Short-term)
scheduling Premt Block
Run
Create
Ready Blocked
Unblock
Medium term
Scheduling
Suspend Suspend
Resume Resume
Ready Blocked
suspended Unblock suspended
Unblock is done by another task (a.k.a. wakeup, release, V) Block is a.k.a. sleep, request, P)
In addition to the short-term scheduling we have discussed, we add medium-term scheduling in
which decisions are made at a coarser time scale.
Recall my favorite diagram, shown again on the right. Medium term scheduling determines the
transitions from the top triangle to the b ottom line. We suspend (swap out) some process if
memory is over-committed, dropping the (ready or blocked) process down. We also need resume
transitions to return a process to the top triangle.
Criteria for choosing a victim to suspend include:
1. How long since previously suspended.
2. How much CPU time used recently.
3. How much memory does it use.
4. External priority (pay more, get swapped out less).
5.5.3 Short-term Scheduling
Short term scheduling concerns with the allocation of CPU time to processes in order to meet
some pre-defined system performance objectives. The definition of these objectives (scheduling
policy) is an overall system design issue, and determines the ``character’’ of the operating system
from the user’s (i.e. the buyer’s) point of view, giving rise to the traditional distinctions among
‘‘multi-purpose, time shared’’, ‘‘batch production’’, ‘‘real-time’’ systems, and so on.
From a user’s point of view, the performance criteria base on:
1. Response time: The interval of time from the moment a service is requested until the
response begins to be received. In time-shared, interactive systems this is a better measure
of responsiveness from a user’s point of view than turnaround time, since processes may
begin to produce output early in their execution.
86 LOVELY PROFESSIONAL UNIVERSITY