Managing Processes
◾
129
number of different scheduling algorithms were developed. The simplest, and perhaps fair-
est, is first come first serve, often known as FIFO for first-in first-out.
In an organization where some users’ processes are more critical than others, a priority
scheme could be used. At a university, for instance, the highest priority might be given to
administration processes with faculty processes given the next highest priority. Processes
submitted by graduate students might come next followed by those of undergraduate stu-
dents. Although not a fair scheme, it represents the needs or priorities of the university.
Within each priority level, submitted jobs might be organized in a simple first come first
serve order.
Another scheduling algorithm is called shortest job first. In this case, the scheduler esti-
mates the execution time needed by the process and orders the waiting jobs in ascending
order of this estimated time. It has been shown that this scheduling algorithm guarantees
the minimum average waiting time. The opposite approach is called longest job first. As
both of these scheduling algorithms estimate execution time, they may not actually yield
the minimum (or maximum) average waiting time.
Whichever algorithm is applied for scheduling, it is the scheduler’s task to order the jobs
and place them in a
queue
(waiting line) reflecting the scheduled ordering. In the case of
the priority scheme, we would have one queue per priority level.
4.2.2 Concurrent Processing
One of the great inefficiencies of batch processing is that of I/O. Imagine, for instance, that
input is to be read from magnetic tape. During execution of the current process, if it needs
to input from tape file, this will cause a pause in the execution because of the relative slow-
ness of tape input. During this time, the CPU idles.
It would be nice to give the CPU something to do while waiting. This leads us to an
improved form of process management called multiprogramming. In multiprogramming,
the CPU continues to only execute a single process, but if that process needs to perform
time consuming I/O, that process is removed from its current position of being executed
by the CPU and moved by the operating system into an I/O queue. The operating system
then selects the next waiting process for execution by the CPU. In doing so, to the user it
appears as if there is more than one process currently executing. We will call this concur-
rent processing. Multiprogramming is one form, we look at others below.
The movement of processes requires a new operation known as a
Do'stlaringiz bilan baham: