Q1:
referring to page 157-158:
Different CPU scheduling aigorithms have different properties, and the choice of a particular algorithm may favor one class of processes over another. In choosing which algorithm to use in a particular situation, we must consider the properties of the various algorithms.
Many criteria have been suggested for comparing cpu scheduling algorithms. Which characteristics are used for comparison can make a substantial difference in which algorithm is judged to be best. The criteria include the following:
CPU utilization. We want to keep the cpU as busy as possible. Conceptually, cpU utilization can range from O to 100 percent. In a real system, it should range from 40 percent (for a lightly loaded system) to 90 percent (for a heavily used system).
Throughput. If the cPU is busy executing processes, then work is being done. One measure of work is the number of processes that are completed per time unit, called throughput. For long processes, this rate may be one process per hour; for short transactions,it may be 10processes per second. . Turnaround time. From the point of view of a particular process, the important criterion is how long it takes toexecute that process.Theinterval from the time of submission of a process to the time of completion is the turnaround time. Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue,executing on the cPU,and doing I/O.
Waiting time. The cPU scheduling algorithm does not affect the amount of time during which a process executes or does I/O;it affects only the- amount of time that a process spends waiting in the ready queue. Waiting time is the sum of the periods spent waiting in the ready queue.
Response time. In an interactive system, turnaround time may not be the best criterion. Often, a process can produce some output fairly early and can continue computing new results while previous results are being output to the user. Thus, another measure is the time from the submission of a request until the first response is produced. This measure, called response time, is the time it takes to start responding, not the time it takes to output the response. The turnaround time is generally limited by the speed of the output device.
Itis desirable to maximize cPU utilization and through put and to minimize turnaround time, waiting time, and response time. In most cases, we optimize the average measure. However, under some circumstances, it is desirable to optimize the minimum or maximum values rather than the average. For example,toguarantee that all users get good service, we may want to minimize the maximum response time.
Investigators have suggested that, for interactive systems (such as time- sharing systems),itis more important to minimize the variance in the response time than to minimize the average response time. A system with reasonable and predictable response time may be considered more desirable than a system that is faster on the average but is highly variable. However, little work has been done on CPU-scheduling algorithms that minimize variance.
As we discuss various cPU-scheduling algorithmsin the following section, we will illustrate their operation. An accurate illustration should involve many processes,each being a sequence of severalhundred cpUbursts and l/Obursts. For simplicity, though, we consider only one cpU burst (in milliseconds) per process in our examples. Our measure of comparison is the average waiting time. More elaborate evaluation mechanisms are discussed 5.7.
Q2:
conclusions:
CPU burst. CPU burst: the amount of time the process uses the processor before it is no longer ready. Types of CPU bursts: long bursts -- process is CPU bound (i.e. array work) short bursts -- process I/O bound (i.e. vi)
CPU burst is when the process is being executed in the CPU.
I/O burst is when the CPU is waiting for I/O for further execution.
After I/O burst, the process goes into the ready queue for the next CPU burst.
something about cycle:
The success of CPU scheduling depends on an observed property of processes: Process execution consists ofa cycle of CPU execution and I/O wait.Processes alternate between these two states. Process execution begins with a CPU burst. That is followed by an l/o burst, which is followed by another CPUburst, then another I/oburst,and so on. Eventually, the finalCPUburstends with asystem request to terminate execution (Figure 5.1).
The durations of CPU bursts have been measured extensively. Although they vary greatly from process to process and from computer to computer, they tend to have a frequency curve similar to that shown in Figure 5.2. The curve is generally characterized as exponential or hyperexponential, with a large number of short CPU bursts and a small number of long CPU bursts. An I/O-bound program typically has many short CPU bursts. A CPU-bound
program might have a few long cpUbursts. This distribution can be important in the selection of an appropriate CPU-scheduling algorithm.