Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Combinatory CPU Scheduling Algorithm

Combinatory CPU Scheduling Algorithm

Ratings: (0)|Views: 812 |Likes:
Published by ijcsis
Central Processing Unit (CPU) plays a significant role in computer system by transferring its control among different processes. As CPU is a central component, hence it must be used efficiently. Operating system performs an essential task that is known as CPU scheduling for efficient utilization of CPU. CPU scheduling has strong effect on resource utilization as well as overall performance of the system. In this paper, a new CPU scheduling algorithm called Combinatory is proposed that combines the functions of some basic scheduling algorithms. The suggested algorithm was evaluated on some CPU scheduling objectives and it was observed that this algorithm gave good performance as compared to the other existing CPU scheduling algorithms.
Central Processing Unit (CPU) plays a significant role in computer system by transferring its control among different processes. As CPU is a central component, hence it must be used efficiently. Operating system performs an essential task that is known as CPU scheduling for efficient utilization of CPU. CPU scheduling has strong effect on resource utilization as well as overall performance of the system. In this paper, a new CPU scheduling algorithm called Combinatory is proposed that combines the functions of some basic scheduling algorithms. The suggested algorithm was evaluated on some CPU scheduling objectives and it was observed that this algorithm gave good performance as compared to the other existing CPU scheduling algorithms.

More info:

Published by: ijcsis on Nov 02, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/13/2011

pdf

text

original

 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 8, No. 7, October 2010
Combinatory CPU Scheduling Algorithm
 
Saeeda Bibi
1
, Farooque Azam
1
,
 
,Yasir Chaudhry
2
 
1
Department of Computer Engineering
College of Electrical and Mechanical Engineering,National University of Science and Technology, Islamabad, Pakistan
2
Department of Computer Science
Maharishi University of ManagementFairfield,Iowa USA{saeedabb, yasiryc }@gmail.com, farooq@ceme.nust.edu.pk  
 Abstract
—Central Processing Unit (CPU) plays a significant rolein computer system by transferring its control among differentprocesses. As CPU is a central component, hence it must be usedefficiently. Operating system performs an essential task that isknown as CPU scheduling for efficient utilization of CPU. CPUscheduling has strong effect on resource utilization as well asoverall performance of the system. In this paper, a new CPUscheduling algorithm called Combinatory is proposed thatcombines the functions of some basic scheduling algorithms. Thesuggested algorithm was evaluated on some CPU schedulingobjectives and it was observed that this algorithm gave goodperformance as compared to the other existing CPU schedulingalgorithms.
 Keywords-component: Operating System, CPU scheduling, First Come First Serve Algorithm, Shortest Job First Algorithm,
I.
 
I
NTRODUCTION
Operating system performs variety of tasks in whichscheduling is one of the basic task. All the resources of computer are scheduled before use; as CPU is one of the majorcomputer resources therefore its scheduling is vital foroperating system [1]. When more than one process is ready totake control of CPU, the operating system must decide whichprocess will take control of CPU first. The component of theoperating system that is responsible for making this decision iscalled scheduler and the algorithm used by it is calledscheduling algorithm [2].In computer system, all processes execute by alternatingtheir states between two burst cycles; CPU burst cycle and I/Oburst cycle. Generally, a process starts its execution with aCPU burst then performs I/O (I/O burst), again another CPUburst then another I/O burst and this alternation of burst cyclecontinues until the completion of the process execution. CPUbound process is that which performs a lot of computationaltasks and do little I/O while I/O bound process is that whichperforms a lot of I/O operations [1]. The typical task performedby the scheduler is to give the control of CPU to anotherprocess when one process is doing the I/O operations. Thereason behind it is that I/O takes long time to complete itsoperation and CPU has to remain idle [3, 4].There are three different types of schedulers that areworking in the operating system. Each scheduler has its owntasks that differentiate it from the others. These are:
 A.
 
 Long-term Scheduler 
It is also called high level scheduler, admission scheduleror job scheduler. It works with the job queue or high levelqueue and decides which process or job to be admitted to theready queue for execution. Thus, the admission of theprocesses to the ready queue for execution is controlled by thelong-term scheduler [5]. The major objective of this scheduleris to give balanced mix of jobs i.e. CPU bound and I/O bound,to the short-term scheduler [6].
 B.
 
 Medium-term Scheduler 
It is also called mid-term scheduler. This scheduler isresponsible to remove the processes from main memory andput them in the secondary memory and vice versa. Thus, itdecreases degree of multiprogramming. This is usually knownas swapping of processes (“swapping-in” or “swapping out”)[5].
Figure 1: Schedulers
Medium-termSchedulerSuspended andSwapped-outueue
 
Readyueue
SuspendedQueue
CPU
 
JobueueInteractiveProgramsJobShort-termSchedulerLong-termScheduleExit
39http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 8, No. 7, October 2010
C.
 
Short-term Scheduler 
It is also called dispatcher or CPU scheduler. It decideswhich process from the ready queue takes control of the CPUnext for execution [1]. Short-term scheduler makes schedulingdecision much more frequently as compared to the other twoschedulers. This decision is made on the basis of twodisciplines these are non-preemptive and preemptive. In non-preemptive, the scheduler is unable to take control of the CPUforcefully from the processes. Processes take control of theCPU until the completion of execution. In preemptive, thescheduler is able to take control of the CPU forcefully from theprocesses when it decides to take CPU to the other process [5].Design of CPU scheduling algorithm affects the success of CPU scheduler. CPU scheduling algorithms mainly dependson the criteria; CPU utilization, throughput, waiting time,turnaround time and response time [5]. Consequently, themajor attempt of this work is to develop an optimal CPUscheduling algorithm that is suited for all types of processesand gives fair execution time to each process.The organization of rest of the paper is as follow: Section IIdiscuses existing scheduling algorithms. Section III describesproposed scheduling algorithm. Section IV contains pseudocode of the algorithm. Experimental Evaluation & Results havebeen given in Section V followed by conclusion.II.
 
O
VERVIEW
O
F
E
XISTING
CPU
 
S
CHEDULING
A
LGORITHMS
 The basic CPU scheduling algorithms, their advantages anddisadvantages are discussed in this section.
 A.
 
First Come First Served (FCFS) Scheduling
It is the simplest CPU scheduling algorithm that permits theexecution of the process on the basis of their arrival time meansthe process having earlier arrival time will be executed first.Once the control of CPU is assigned to the process, it will notleave the CPU until it completes its execution. For smallprocesses this technique is fair but for long processes it is quiteunfair [7].This algorithm is simple and can be implemented easilyusing FIFO queue. The problems of this algorithm are: theaverage waiting time, average turnaround time and averageresponse time are high therefore it is not suitable for real timeapplications [9]. A long burst time process can monopolizeCPU, even if burst time of other process is too short calledconvoy effect. Hence throughput is low [8].
 B.
 
Shortest Job First (SJF) Scheduling
This algorithm is non-preemptive in nature and permits theprocesses to execute first that have smaller burst time [10]. If more than one process has same burst time then control of CPUis assigned to them on the basis of First Come First Served. Inmost system, this algorithm is implemented for maximumthroughput [5].SJF algorithm is an optimal scheduling algorithm; it givesminimum average waiting time and average turnaround time[11] because it executes small processes before large ones. Thedifficulty of this algorithm is to know length of CPU burst of next process and it is usually unpredictable [9], there is also aproblem of starvation in this algorithm because the arrival of processes having short CPU burst prevents processes havinglong CPU burst to execute [5].
C.
 
 Round Robin (RR) Scheduling
In this algorithm, a small unit of time called time quantumor time slice is assigned to each process. According to that timequantum processes are executed and if time quantum of anyprocess expires before its complete execution, it is put at theend of the ready queue and control of the CPU is assigned tothe next incoming process.Performance of Round Robin totally depends on the size of time quantum. If size of time quantum is too small; it willcause many context switches and also affect the CPUefficiency. If time quantum is too large; it will give poorresponse time that approximately equal to FCFS [1]. Thisalgorithm is preemptive in nature [7] and is suitable for timesharing systems. Round Robin algorithm gives high waitingtime therefore deadlines are rarely met in it [5].
 D.
 
Priority Based Scheduling
In this algorithm, priority is associated with each processand on the basis of that priority CPU is allocated to theprocesses. Higher priority processes are executed first andlower priority processes are executed at end [4]. If multipleprocesses having the same priorities are ready to execute,control of CPU is assigned to these processes on the basis of FCFS [1, 3].In this algorithm, average waiting time and response timeof higher priority processes is small while waiting timeincreases for processes having equal priority [5, 12]. The majorproblem with this algorithm is problem of starvation that can besolved by a technique called aging [1].
 E.
 
SJRR CPU Scheduling Algorithm
In this algorithm, all the incoming processes are sorted inascending order in the ready queue. Time quantum is
Identify applicable sponsor/s here.
(sponsors)
Identify applicable sponsor/s here.
(sponsors)
40http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 8, No. 7, October 2010
calculated and assigned to each process. On the basis of thattime quantum, processes are executed one after another. If time quantum expires, CPU is taken from the processesforcefully and assigned to the next process; the preemptedprocesses are put at the end of the ready queue [7].SJRR is provides fair share to each process and is useful intime sharing systems. It provides minimum average time andaverage turnaround time [7]. The problem with this algorithmis that if calculated time quantum is too small then there isoverhead of more context switches.III.
 
P
ROPOSED
S
CHEDULING
A
LGORITHM
 In this algorithm, a new factor F is calculated that isaddition of two basic factors (arrival time and burst time of theprocesses). Here is the equation that shows this relation:F= Arrival Time + Burst TimeThis factor F is assigned to each process and on the basisof this factor processes are arranged in ascending order in theready queue. Processes having highest value of the factor areexecuted first and those with lowest value of the factor areexecuted next. Depend on this new factor CPU executes theprocess that:
 
Has shortest burst time
 
Submit to the system at startProposed CPU scheduling algorithm reduces waiting time,turnaround time and response time and also increases CPUutilization and throughput. It has resolved the problem of starvation at much more extent and there is no problem of context switching in this algorithm.The working of the proposed algorithm is as given below:1.
 
Take list of processes, their burst time and arrivaltime.2.
 
Find the factor F by adding arrival time and bursttime of processes.3.
 
On the basis of factor, arrange processes and theirrelative burst time in ascending order using anysorting technique.4.
 
Calculate waiting time of each process.5.
 
Iterate through the list of processesa.
 
Add total waiting time with waiting time of each process to find total waiting timeb.
 
Add burst time and waiting time of eachprocess to find turnaround timec.
 
Add total turnaround time and turnaround timeof each process to find total turnaround time6.
 
Average waiting time is calculated by diving totalwaiting time with total number of processes.7.
 
Average turnaround time is calculated by dividingtotal turnaround time with total number of processes.IV.
 
P
SEUDO
C
ODE
 
0temp
0total_tatime
0.0tw_time
0.0avg_wt
0.0avg_tatime
0.0For i
0 to processF[i]
atime[i] + btime[i]For i
process-1 to 0For j
1 to processIF F [j-1] > F[j]
F[j-1]F [j-1]
F[j]F [j]
temp
btime[j-1]btime[j-1]
btime[j]btime[j]
tempptemp
proname[j-1]proname[j-1]
proname [j]proname[j]
ptempwtime [1]
0For j
1 to countwtime[j]
btime [j-1] + wtime [j-1]For j
0 to processtw_time
tw_time + wtime[j]tatime[j]
b[j] + wtime[j]total_ tatime
total_tatime+ tatime[j]avg_wt
tw_time / processavg_tatime
total_tatime/ process
V.
 
E
XPERIMENTAL
E
VALUATION
&
 
R
ESULTS
 To explain the performance of proposed schedulingalgorithm and to compare its performance with theperformance of existing algorithms; consider the following setof processes along with their burst time, arrival time inmilliseconds and priority in numbers as shown in the Table 1:
Process
 
Name
 
 Arrival
 
Time
 
Burst 
 
Time
 
Priority
 
P1
 
0
 
20
 
6
 
P2
 
1
 
10
 
8
 
P3
 
2
 
3
 
2
 
P4
 
3
 
13
 
1
 
P5
 
4
 
10
 
4
 
Table 1: Set of Processes
41http://sites.google.com/site/ijcsis/ISSN 1947-5500

Activity (3)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
ggardu liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->