Sunday, 25 September 2011

Priority



The basic idea is straightforward: each process is assigned a priority, and priority is allowed to run. Equal-Priority processes are scheduled in FCFS order. The shortest-Job-First (SJF) algorithm is a special case of general priority scheduling algorithm.

An SJF algorithm is simply a priority algorithm where the priority is the inverse of the (predicted) next CPU burst. That is, the longer the CPU burst, the lower the priority and vice versa.
Priority can be defined either internally or externally. Internally defined priorities use some measurable quantities or qualities to compute priority of a process.


Examples of Internal priorities are

Time limits.
Memory requirements.
File requirements. For example, number of open files.
CPU Vs I/O requirements.

Externally defined priorities are set by criteria that are external to operating system such as

The importance of process.
Type or amount of funds being paid for computer use.
The department sponsoring the work.
Politics.

Priority scheduling can be either pre-emptive or non pre-emptive
  • A preemptive priority algorithm will pre-emptive the CPU if the priority of the newly arrival process is higher than the priority of the currently running process.
  • A non-preemptive priority algorithm will simply put the new process at the head of the ready queue.
A major problem with priority scheduling is indefinite blocking or starvation. A solution to the problem of indefinite blockage of the low-priority process is aging. Aging is a technique of gradually increasing the priority of processes that wait in the system for a long period of time.



Disediakan Oleh: Che Nurlailatul Ashikin

No comments:

Post a Comment