Enhanced Precedence Scheduling Algorithm with Dynamic Time Quantum (epsadtq)

This study proposes a new algorithm which is a logical extension of the popular Round Robin CPU scheduling algorithm. The Round Robin algorithm can be effective only if the time quantum is chosen accurately. Even by taking mean average of burst times as time quantum, the performance of the RR cannot be improved beyond a certain point. However, the novel method proposed here, suggests that a priority be assigned to each process based on balanced precedence factor. The novel method also uses mean average as a time quantum. Experiments are conducted in order to measure the effectiveness of this novel method. The results clearly showed that EPSADTQ is superior to RR and PSMTQ and its variants. EPSADTQ resulted in a significant reduction of the no. of context switches, average waiting time and average turnaround time.


INTRODUCTION
CPU scheduling is an essential operating system task, which is the process of allocating the CPU to a specific process.
Scheduling requires careful attention to ensure fairness and avoid process starvation in the CPU.Main aim of the scheduling is to maximize CPU utilization, Throughput and to minimize response time, context switches, waiting time and turnaround time.Existing scheduling algorithms are based on priority of the process are not fair and suffer from problem of starvation.If we use round robin algorithm then we can achieve fairness but at the cost of neglecting the effect of priority totally and large number of context switches.The Precedence scheduling algorithm with Intelligent Service time is still producing large number of context switches and Factor of Precedence is not balanced among the priority and burst times.This motivated me to design and develop a novel algorithm which uses Balanced Factor of Precedence (BFP) to determine the order of execution of various processes.It uses Mean average of burst times of processes as its time quantum.This will reduce the number of context switches, average waiting time and average turnaround time.It also attains better response time.

PRELIMINARIES
A process is Program in execution.The processes waiting to be assigned to a processor are put in a queue called ready queue.The time for which a process holds the CPU is known as burst time.Arrival Time is the time at which a process arrives at the ready queue.The interval from the time of submission of a process to the time of completion is the turnaround time.Waiting time is the amount of time a process has been waiting in the ready queue.The number of times CPU switches from one process to another is known as context switch.The optimal scheduling algorithm will have minimum waiting time, minimum turnaround time and minimum number of context switches.

Basic scheduling algorithms:
First Come First Serve (FCFS): First-Come-First-Serve (FCFS) algorithm, the CPU is assigned immediately to that process which arrives first at the ready queue.

Shortest Job First (SJF):
In SJF the process with low burst time is scheduled first.
If two processes having same burst time and arrival time, then FCFS procedure is used.

Shortest Remaining Time First (SRTF):
Similar as the SJF with pre emption, which small modification.For scheduling the jobs system need to consider the remaining burst time of the job which is presently executed by the CPU also along with the burst time of the jobs present in the ready queue.

Priority scheduling algorithm:
The priority to each process and selects the highest priority process from the ready queue for the execution.
Round robin scheduling algorithm: Round Robin (RR) is one of the oldest, simplest and fairest and most widely used scheduling algorithms, designed especially for time-sharing systems.In this every process has equal priority and is given a time quantum after which the process is preempted.

LITERATURE REVIEW
Efforts have been made to modify round robin in order to give better results of turnaround time, average waiting time and minimize context switches (Varma, 2012;Siva Nageswara Rao, 2014).The concept of average mean time quantum has been suggested in Noon et al. (2011) and Siva Nageswara Rao (2014,2015).Employing the concept of priority along with round robin has been suggested in Himanshi and Prashant (2012) and Siva Nageswara Rao (2014,2015).
Proposed algorithm: Newly proposed algorithm overcomes the problem of starvation since it considers both priority as well as burst time equally called balanced factor of precedence to compute the order of execution: Using, BFP i = 0.5 * P i +0.5 * BT i where, BT is assigned in such a way that shorter process gets Lower number P denotes Priority of the Process.
To produce good response time, the algorithm shares the time quantum among the processes.It is best suited for time shared systems.The time quantum is taken as the mean average of burst times of the processes with varying dynamic time quantum (Siva Nageswara Rao, 2014).Due to this, it does not produce poor response time and also it will have less number of context switches.That is why the proposed algorithm produces better results.The algorithm is as follows: 1. Begin 2. Burst times, Priority of each process are taken as input 3. Give value of Burst Time in such a way that shorter process gets lower number.4. Evaluate Balanced Factor of Precedence (BFP) as follows: BFP i = 0.5 * P i +0.5 * BT i For each process in the Queue.Where P denotes priority and Burst Time is the value denoted in step 3.

The Order of Execution (OE) is assigned to
processes such that the process with lowest BFP will be executed first.If there are any ties in BFP values then it will be resolved by considering process with lowest burst time.6.Now, the execution sequence is found and compute the time quantum using: where, N represents Number of Processes i.e., Time quantum is the Mean Average of the Burst times of processes in the Ready Queue.7. Assign a Time Quantum to process P i for each i if the remaining burst time of current execution process is less than or equal to one time quantum then execute the same process otherwise go for next process in the ready queue.8. Repeat step 7 until the ready queue becomes empty.9. END

EXPERIMENTS AND ILLUSTRATION
Assumptions: All experiments are assumed to be performed in single processor environment and all the processes are not dependent from each other.Parameters like burst time and priority are known prior to submission of process.All processes are CPU bound.No process is input and output bound.

Illustration and results:
Example: Consider there are 5 processes.Burst time and arrival time have been assumed to be in milliseconds.We calculate BFP to find the order of execution and assign value of Burst Time in such a way that shorter process gets lower number.Mean average is calculated and considered as time quantum.
Let us consider the following processes with their priorities and burst times.Now Lower number of Burst Time is given to shorter process.
Balanced Factor of Precedence (using BFP i = 0.5 * P i +0.5 * BT i ) is evaluated to find the order of execution.Process with Lowest BFP value will be executed first and Process with h i g h BFP value will be executed last.Hence Table 1 to 3 having the all the information regarding all the process of BT, BFP and Execution Order.With the help of Execution Order, process the jobs from the ready queue.Now Time Quantum is computed as Mean average of Burst times: Time Quantum (TQ) = ∑ Burst time i /n TQ = (11+53+8+41+20)/5 = 27 AWT = 28+80+20+39+0/5 = 33.ATT = 39+133+28+80+20/5 = 60.Compare the above results with other variants of RR and PSMTQ scheduling algorithm are as follows: From the above graphs we can observe that the proposed algorithm is producing optimal values in terms of context switches, average turnaround time and average response time.Figure 1 to 4 shows comparison among various scheduling algorithms.

CONCLUSION AND RECOMMENDATIONS
From the above experimental results, we can say that the proposed algorithm EPSADTQ works better than any other variants of RR and PSMTQ scheduling algorithms in terms of decreasing number of Context switches, average waiting time and average turnaround time.Future work can be based on this algorithm that includes processes Preemptive process mechanism and arrival time for each process.

Table 1 :
Various jobs with their burst time