C) Priority Scheduling : In this method a priority is
associating with each job, and the CPU is allocated to the
job with the highest priority. Equal priority jobs are
scheduled FCFS.
SJF is a type of priority scheduling
algorithm. The priority is the inverse of the next CPU burst time.
Priorities can be defined either internally or externally. Internal
priority can be defined based on time limits, memory requirements, the
no. of open files, the ration of average CPU to I/O burst. External priority is
defined in terms of amount of money being paid for computer use, the
department, and political factors. A priority
scheduling algorithm can leave some job indefinitely waiting for the CPU.
A solution to this problems is aging. Aging is a
technique of gradually increasing the priority of job that wait in
the systems for a long time.
2. A) Shortest
Remaining Time First : In this
method when a job arrives new in the queue, the present
executing job is continued if the CPU burst of the new job is more
than the remaining CPU burst of the present job. Otherwise,
the present executing job is preempted and the new job is taken up.
As an example, consider the following jobs.
B) Preemptive
Priority Scheduling : When a job
arrives at the ready queue (as a result of finishing its
previous I/O request), its priority is compared with the priority
of the currently running process. The CPU is preempted if the priority of
the currently running process is smaller than of newly
arrived process, and is assigned to the new process.