Chapter 15 Flashcards
What is SJF
Shortest job first is a scheduling algorithm in which the process with the smallest execution time is selected for execution next. Shortest job first can be either preemptive or non-preemptive.
What are 2 versions of SJF
preemptive
non-preemptive
What is preemptive and non-preemptive version of SJF
Tasks are usually assigned with priorities. At times it is necessary to run a certain task that has a higher priority before another task although it is running. Therefore, the running task is interrupted for some time and resumed later when the priority task has finished its execution. This is called preemptive scheduling.
Eg: Round robin
In non-preemptive scheduling, a running task is executed till completion. It cannot be interrupted.
Eg First In First Out
Which is optimal non-preemptive scheduler
SJF is optimal scheduling algorithm and no scheduler gives such good performance.
What is CPU burst time and CPU burst
While scheduling, each process gets to use the CPU for it’s slice. The slice that it gets, is called the CPU burst. In simple terms, the duration for which a process gets control of the CPU is the CPU burst time, and the concept of gaining control of the CPU is the CPU burst.
Does Preemptive SJF also called Shortest remaining time first (SRTF)
Yes
What is arrival time
Time at which the process arrives in the ready queue.
What is exponential averaging
We can not know exactly the length of next CPU burst. We can only estimate the length of next CPU burst. It can only be done by using the length of previous CPU bursts using the exponential averaging.
Does a process can have multiple CPU burst in its life time
Yes
What is priority scheduling algorithm
Priority scheduling algorithm is used in a system when every process is assigned a priority. A priority number(integer) is associated with each process. Its a rule the smaller the number of priority has the highest priority.
What is starvation problem
If there is high priority process use to come in system then low priority process will not get chance to proceed. It is called starvation problem.
What is solution of starvation problem
Aging. As time progress increases the priority of task increases. Example of a shop keeper. Old customer waiting in queue will get high priority because he is waiting for sometime.
What about task have 0 priority
It has highest priority