In operating system the CPU scheduler is designed in such a way that all the resources are fully utilized. With static priority scheduling the scheduler ensures that CPU time will be assigned according to the highest priority but ignores other factors; hence it affects the performance. To improve the performance, we propose a new 2stage vague logic based scheduler. In first stage, scheduler handles the uncertainty of tasks using the proposed vague inference system (VIS). In second stage, scheduler uses a vague oriented priority scheduling (VOPS) algorithm for selection of next process. The goal of this work is to handle the uncertainty as well as to optimize both the average and the amount of variation with respect to performance matrices average waiting time, average turnaround time, and average normalized turnaround time. A simulation using MATLAB is also conducted to evaluate the performance. Simulation results show that the proposed scheduler using VOPS algorithm is better than the scheduler with traditional priority scheduling algorithm. Results are based on the dual concept of fuzzy theory and its generalization, vague theory. Additionally, this work comprises the evaluation of VOPS and shortest job first algorithm. The outcome of proposed VOPS algorithm is much closer to the result obtained by traditional shortest job first.
CPU Scheduler is the main module of any operating system, as it selects the next task to be run. It runs a scheduling algorithm for selection of task. When more than one task is ready to execute, scheduling algorithms will decide which one is to run first. Hence, the designer of scheduler must consider the scheduling algorithm which provides effective throughput.
Operating system is not capable to know the exact attributes values of the task, namely, execution time and so forth. Recent developments in priority scheduling have made significantly enhancements to the models considering uncertainty factors. These models accommodate the attributes of tasks with Fuzzy logic.
This paper is written with the aim of focusing on the uncertainty and impreciseness of attributes with vague logic and generalized form of fuzzy logic. The vague set theory improves the modeling of real world, becoming a committing tool to deal with imprecise knowledge. In addition to vague implementation, second aim is to improve the performance of priority scheduling algorithm. In this paper we are proposing a new 2stage scheduler with VOPS (vague oriented priority scheduling) algorithm. Proposed CPU Scheduler works in two stages; for the first stage we are introducing a vague inference system to generate dynamic priorities for tasks by considering the impreciseness of attributes and for second stage of scheduler we are projecting a new vague oriented priority scheduling algorithm to schedule the next process to CPU.
The paper is organized as follows. Section
Priority scheduling algorithm is used by scheduler when all tasks are not equally important [
To consider the current state of the ready queue, the dynamic priority concept over static priority has introduced that proved the better performance [
Fuzzy logic was introduced by Professor Zadeh in his seminal paper and provides the basis for further development [
The important aspect of this paper is to generate dynamic priorities for the tasks as it is necessary for the system to consider all the attributes to facilitate dynamic priority. Here system considers two attributes: burst time of the tasks and the static priority. For this we are proposing a 2stage scheduler using “vague oriented priority scheduling (VOPS) algorithm.” We claim that the proposed algorithm improves the average waiting time, average turnaround time, and average normalized turnaround time.
In next section we will discuss preliminaries of vague set theory which is essential to define the proposed work.
Professor Zadeh had changed the approach in the field of logics by proposing a novel fuzzy logic in 1965 where each element in fuzzy set has a single membership value in between 0 and 1 [
Let
Gau and Buehrer [
A vague set
a truth membership function
a false membership function
The vague set
For example, consider a universe
Vague membership function.
Median membership represents the overall evidence contained in a vague value. It is defined as
Median membership function.
The vague value
Let
The proposed vague logic based scheduler has the ability of learning and keeping track of tasks. Based on this capability scheduler adjusts their priorities periodically. For example, if a new task T2 with higher static priority and maximum burst time arrives in the RQ and task T1 with slightly lower priority but minimum burst time is already in the RQ. Then the traditional scheduler will schedule the task T2 based on highest priority but our scheduler will recomputed the priority based on the current values of burst time and static priority and schedules accordingly.
Proposed scheduler works in two stages as shown in Figure
2Stage scheduler.
Our considerations are limited to a single processor system that supports a fixed number of tasks
Let
Likewise
Proposed VIS has two units, vague logic unit (VLU) and the median membership function unit (MFU) as shown in Figure
Vague inference system.
The idea of pairing the membership (truemembership) and nonmembership (falsemembership) values in VLU from vague set theory are to represent the imprecise or uncertain information of tasks discussed in Section
The output from the VLU is passed as the input to the second unit MFU. MFU computes the aggregate truth value enclosed in the vague value by using the median membership function. Equation (
Further, these median membership values are used by VIS to assign the dynamic priority
In VOPS algorithm, the tasks are sorted in descending order according to their dynamic priority and the highest priority task is scheduled first to the CPU. Whenever a new task arrives, the dynamic priority is recalculated for all the ready tasks and ready queue is updated accordingly. For Example, if there are 3 tasks T1, T2, and T3 in the RQ. Then the dynamic priority of all these tasks will be calculated. Assuming task T2 is having highest priority, and then T2 will be assigned to CPU. Now during the execution of T2, another task T4 has arrived. After the completion of T2, the dynamic priorities for each task will be recalculated and task with highest priority would be scheduled to CPU.
Waiting time is the total time tasks waits in the ready queue for CPU. The average waiting time is calculated as given in (
Turnaround time is the total time between the submission of a task and its complete execution. For better performance, the average turnaround time should be minimized and it can be calculated as in (
Normalized turnaround time is the ratio of turnaround time to burst time. It represents the relative delay of the task and can be calculated as in (
Algorithm
(i) Assign
(ii) Compute the dynamic priority
End loop
End loop
(i) Schedule and dispatch process
(ii) Calculate waiting time, turnaround time and normalized turnaround time for process
(iii) After completion of each process
End loop
MATLAB is used to simulate our effort in designing the algorithm. To implement the VIS of the two functions which are defined inside the VLU,
Algorithm
for
end
Algorithm
for
End
For the working of algorithm, consider a simple example involving 5 different tasks T1 to T5. Table
Example Task Set 1.
Task  

T1  T2  T3  T4  T5  
Priority  6  5  1  4  2 
Burst time  3  24  6  9  8 
The VIS extracts the static priority and burst time for each task T1–T5. After applying the
Updated Task Set 1.
Task  

T1  T2  T3  T4  T5  
Dynamic priority  0.94  0.23  0.85  0.7  0.74 
Burst time  3  24  6  9  8 
Now the VOPS algorithm is applied over the updated Task set 1. The highest priority task is scheduled first to the CPU. Scheduling is represented in the form of Gantt chart as given in Figure
(a) Gantt chart for VOPS. (b) Gantt chart for PS. (c) Gantt chart for SJF. (d) Gantt chart for FS.
When we schedule the task set in Table
Based on the Gantt chart waiting time, turnaround time and normalized turnaround time are computed as shown in Figures
(a) Waiting time for sample task set 1. (b) Turnaround time for sample task set 1. (c) Normalized turnaround time for sample task set 1. (d) Results of sample task 1.
Further we have calculated the average waiting time (
Outcomes of Task Set 1.
S. no.  Scheduling technique 




1  PS  22  32  3.99 
2  SJF  11  21  1.92 
3  FS  12  22  3.99 
4  VOPS  11  21  1.92 
From the outcomes of Task Set 1 given in Table
Example Task Set 2.
Task  

T1  T2  T3  T4  
Priority  7  1  15  4 
Burst time  10  5  4  8 
As mentioned in Task Set 1, VIS extracts the priority and burst time of each task and generates the dynamic priority as given in Table
Updated Task Set 2.
Task  

T1  T2  T3  T4  
Dynamic priority  0.55  0.94  0.82  0.74 
Burst time  10  5  4  8 
Once again after applying VOPS algorithm to the updated Task Set 2 and it is scheduled as shown in Figure
(a) Gantt chart for VOPS. (b) Gantt chart for PS. (c) Gantt chart for SJF. (d) Gantt chart for FS.
Then all of the remaining three algorithms PS, SJF, and FS are applied. Gantt chart for all is shown in Figures
Figures
(a) Waiting time for sample task set 2. (b) Turnaround time for sample task set 2. (c) Normalized turnaround time for sample task set 1. (d) Results of sample task 2.
The overall computation of Sample Task Set 2 in terms of average waiting time, average turnaround time, and average normalized turnaround time is shown in Figure
Overall results of each scheduling techniques are analyzed in Table
Outcomes of Task Set 2.
S. no.  Scheduling technique 




1  PS  10  16.75  2.64 
2  SJF  7.5  14.25  1.91 
3  FS  8  14.75  2.02 
4  VOPS  7.75  14.5  2.01 
Similarly, one can judge that the performance of proposed VOPS algorithm, given in Table
VOPS algorithm are simulated on different task sets having the random values of burst time and static priority and the average waiting time, average turnaround time, and average normalized turnaround time for each task set are calculated. For accuracy VOPS algorithm is compared for all task sets with other algorithms such as priority scheduling (PS), shortest job first (SJF), and fuzzy based priority scheduling (FS).
Figure
Average waiting time.
Average turnaround time.
Average normalized turnaround time.
VOPS scheduling algorithm has better performance mainly by two reasons.
The proposed VOPS algorithm is considering the current state of tasks in ready queue and address the impreciseness of data. As a result, VOPS is effective for dynamic environment. Secondly, the performance of scheduling algorithms mainly depends on multiple factors, namely, average waiting time, average turnaround time, and average normalized turnaround time. The reduction in the value of factors improves the performance. As a result, VOPS improves the performance of the system.
As discussed above some applications and research show that SJF algorithm is better than the priority scheduling algorithm since it provides the less waiting time and less turnaround time. In dynamic applications, priority algorithm must be required by scheduler to assign the different priority order to different tasks. In this paper we have introduced a 2stage CPU scheduler based on vague set theory. In the first stage, scheduler used the VIS to handle the impreciseness and uncertainty. For this purpose, VIS applied the vague set theory and converted crisp data in to vague data. To determine the total evidence in vague values, the median membership function is used in the VIS. Finally VIS generated the dynamic priority for all tasks in ready queue by considering the factors burst time and the user priority. In the second stage, scheduler has selected the next task with vague oriented priority scheduling (VOPS) algorithm. The proposed 2stage scheduler improves the performance of the system as compared to the system using conventional priority scheduling algorithm and fuzzy scheduling algorithm. To validate the performance we have simulated different task sets which verifies that our propose algorithm significantly reduces the average waiting time, average turnaround time, and average normalized turnaround time and consequently improves the performance.
The authors declare that there is no conflict of interests regarding the publication of this paper.