Professional Documents
Culture Documents
Aspen Olmsted
Department of Computer Science
College of Charleston
Ahana Roy Charleston, SC, USA
Department of Computer Science olmsteda@cofc.edu
College of Charleston
Charleston, SC, USA
roya@g.cofc.edu
Abstract—Operating system handles a variety of functions − Throughput: number of processes that complete their
such as process management, resource allocation, memory
management, networking, file management to name few. Out of execution per time unit
these tasks, resource allocation is of utmost importance. The
currently existing algorithms have some problems associated with − Turnaround time: interval from submission time of a
them. Some of them can lead to endless waiting or starvation and process to completion time
some of them like round robin has problem of too many context
switches and high waiting time. The sole aim of this paper is to − Waiting time: amount of time a process has been
develop an improvement to existing priority scheduling waiting in the ready queue
algorithm used for scheduling in interactive systems. The
proposed algorithm not only reduces overhead of swapping − Response time: amount of time it takes from when a
priorities but also response/waiting times. request was submitted until the first response is
produced
Keywords—CPU scheduling, CPU utilization, Throughput,
Turnaround time, Waiting time, Response time, Context switch rate, With a priority scheduler, the scheduler simply picks the
Priority scheduling algorithm, Starvation, CPU burst, Gantt chart highest priority process to run. If the system uses preemptive
scheduling, a process is preempted whenever a higher priority
I. INTRODUCTION process is available in the run queue. Priorities may also be
Scheduling forms the basis of multi-programmed operating static or dynamic. A process with a static priority keeps that
systems. It is because scheduling determines which processes priority for the entire life of the process. A process with a
run when there are multiple runnable processes. dynamic priority will have that priority changed by the
scheduler during its course of execution. The scheduler would
Scheduling algorithm improves processor’s efficiency by do this to achieve its scheduling goals. For example, the
improving its utilization. First Come, First Serve (FCFS) [1], scheduler may decide to decrease a process’ priority to give a
Shortest Job First (SJF) [1] [2], Shortest Remaining Time First chance for lower-priority job to run. If a process is I/O bound
(SRTF) [1], Round Robin (RR) [1] [3], Highest Response (spending most of its time waiting on I/O), the scheduler may
Ratio Next (HRRN), Mid Average Round Robin (MARR) [4], give it a higher priority so that it can get off the run queue
Adaptive Round Robin (Adaptive RR) [5], Improved Round quickly and schedule another I/O operation. Static and
Robin Approach using Dynamic Time Quantum (IRRADTQ) dynamic priorities can coexist. A scheduler would know that a
[6] and Varying Response Ratio Priority (VRRP) [7] are some process with a static priority cannot have its priority adjusted
of the examples of scheduling algorithms. As performance of throughout the course of its execution. Ignoring dynamic
the algorithm may vary under various situations [2], so the priorities, the priority scheduling algorithm is straightforward:
possible criteria for selection of a proper algorithm can be each process has a priority number assigned to it and the
reduced context switch count, increased throughput, increased scheduler simply picks the process with the highest priority
processor use, reduced waiting time, reduced response time [1].
and reduced turnaround time [8]. To choose the best and
appropriate algorithm we need to focus on following criteria In this paper, we will be handling indefinite blocking (or
[1]: starvation), a major problem in priority scheduling algorithms.
A process that is ready to run but lacking the CPU can be
− CPU Utilization: our main goal is to keep the CPU as considered blocked-waiting for the CPU [1]. A priority
scheduling algorithm can leave some low-priority processes
busy as possible
waiting indefinitely for the CPU. One approach to this
problem of indefinite postponement is to use dynamic process with highest instantaneous priority is allocated to the
priorities. At the expiration of each quantum, the scheduler processor. From the results of the study, the authors inferred
can decrease the priority of the current running process that CEHIPN will never lead to starvation and has much better
(thereby penalizing it for taking that much CPU time). results in terms of average waiting time, average response
Eventually its priority will fall below that of the next highest time, when compared with FCFS, SJF, RR, Highest Response
process and that process will be allowed to run. Another Ratio Next, Varying Response Ratio Priority, Mid Average
approach is to have the scheduler keep track of low priority Round-Robin and Adaptive Round Robin.
processes that do not get a chance to run and increase their
priority so that eventually the priority will be high enough so Lottery scheduling solves the problem of starvation [3].
that the processes will get scheduled to run. Once it runs for its Processes are each assigned some number of lottery tickets,
quantum, the priority can be brought back to the previous low and the scheduler draws a random ticket to select the next
level. This periodic boosting of a process’ priority to ensure it process to be executed. Giving each process at least one
gets a chance to run is called process aging [1]. lottery ticket guarantees that it has non-zero probability of
being selected at each scheduling operation. On average, CPU
The rest of the paper is organized as follows. Section II time is proportional to the number of tickets given to each job.
and III discusses relative work and our proposed algorithm To avoid starvation, every job gets at least one ticket. Thus,
respectively. In Section IV and V, implementation and lottery scheduling can be used to solve problems involving fair
corresponding results are shown. Finally, we conclude and share of CPU [18].
discuss future work in Section VI.
In Standard Deviation based CPU scheduling [19], a queue
II. RELATED WORK is maintained in which processes are ordered based on the
burst time value proximity with the value of the standard
The major drawback associated with First Come, First deviation. Process whose burst time is closest to the standard
Serve (FCFS) [1] scheduling algorithm is that being a deviation value will be executed first.
non-preemptive approach it waits for a less important
time-consuming process to finish first. To overcome this III. HYPOTHESIS
problem Shortest Job First (SJF) algorithm was proposed in
which the job with shorter burst time is executed first [1] [3]. Our hypothesis is an improvement to existing enhanced
But in this approach if short processes keep coming in priority scheduling algorithm [20]. Our purpose is to achieve
sequence, then any long process must wait endlessly for its the following objectives:
chance and may starve [9]. A new algorithm was proposed − maximized CPU utilization
Shortest Remaining Time First (SRTF) [1]. This is a
preemptive approach in which job with shorter remaining time
− maximized throughput
is executed first. Again, problem was the same, if new jobs
with shorter running time keep coming then an older job with
larger remaining time must wait endlessly creating a condition − minimized (average) turnaround time
of starvation.
− minimized (average) waiting time
To overcome starvation, a new algorithm Round Robin
(RR) was introduced [1] [3]. In this approach processor − minimized (average) response time
handles each process in recurring order and for a fixed time
quantum. Hence each process gets the processor equally and − minimized context switch rate
no process ever starves. But because of these frequent
switching RR is associated with many context switches and − fairness of resource allocation
high average waiting time [10]. To further reduce the average
waiting time, many improvements over round-robin algorithm We propose an algorithm which aids in minimizing
were proposed [11] [12] [13]. Like Proportional Share some of the above performance parameters such as
scheduling algorithm, which was proposed by Helmy and response time, waiting time for lower priority processes
Dekdouk [14], this algorithm inherits features from ensuring each process is given a fair chance to access
round-robin and is encouraging for shorter jobs. Shortest resources.
Remaining Burst Round Robin (SRBRR) scheduling
algorithm assigns the processor to processes with shortest Step 1: The tasks are sorted according to their priorities.
remaining burst in round robin manner using the dynamic time Lower numbers are used to represent higher priorities. The
quantum [15]. Priority Based Dynamic Round Robin process with the highest priority is allocated first and those
(PBDRR) algorithm uses intelligent time slice and holds with the same priorities are scheduled by FCFS policy.
features from Priority algorithm and Round Robin [16]. Step 2: Allocate all sorted process to CPU for a
Researchers proposed another novel approach; a predetermined time slice. Value of time slice = (process
preemptive priority base scheduling algorithm namely with shortest burst time + process with largest burst
Chronically Evaluated Highest Instantaneous Priority Next time)/2
(CEHIPN) [17]. This algorithm takes the instantaneous Step 3: After all the processes have been executed once
remaining time and waiting time of the processes into using the given time slice, instead of symmetrical
consideration to calculate their instantaneous priority. Then the
swapping of process priorities [20], allocate the incomplete Scheduling) (in
processes a new value of time slice = average of remaining sec)
burst times.
P5 0 0
Step 4: Repeat step 3 until the completion of execution of
all processes in the queue. P3 97 62.5