Home » Operating Systems

Problem associated with Priority Scheduling and it’s Solution

In this article, we are going to learn about the problem associated with priority scheduling and its solution.
Submitted by Basantjeet Das, on November 07, 2018

We are already familiar with what Priority Scheduling is. It is one of the most used process scheduling algorithm used in operating systems, in which every process is assigned with a priority. According to this algorithm, the process with the highest priority is set to be provided the CPU first or simply is to be executed first.

In priority scheduling algorithm, a major problem to be considered is the starvation of a process i.e. a process which is ready to be executed but is waiting for the CPU because of its low priority. This can lead to the indefinite waiting of the low-priority processes. A continuous flow of higher priority processes to the O.S can prevent a low priority process from ever getting the CPU.

Let's take an example to understand what starvation is. Suppose there are 100 processes in which a process 'X' has the lowest priority because of which it will be executed at last. Let say before the process 'X' is provided CPU for the execution some more processes are provided to the operating system having a priority higher than that of process 'X'. Now what will happen is, the process 'X' won't get the chance to get executed no matter what was its arrival time. It is possible that, as the time passes by the O.S is given more processes having higher priority than that of 'X', due to which 'X' can wait indefinitely or could never be executed. This Problem is known as 'Starvation'.

For solving the problem of starvation we have the concept of Aging. In aging what we do is increasing the priority of those process that has been waiting long because of low priority after some specified amount of time. Due to which after the specified time its priority is increased and could be provided with the CPU for the execution.

Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.