Q1. If the reference string is
0 1 2 3 0 1 4 0 1 2 3 4
then solve by First In First Out Disk Scheduling Algorithm using physical memory of three frames and four frames.
The below figure shows how with 3 frames the number of page faults are 9 while we get 10 page faults with 4 frames.
Page faults = 9 (3 frames)
Page faults = 4 (4 frames)
Q1. How can we optimize First In First Out Disk Scheduling Algorithm?
Ans.A simple optimization to FIFO algorithm is to attach a reference bit for each page in page table. Each time the page is accessed the page bit is set to 1. When a page fault occurs that respective bit is checked and if it is 1 then set the bit to 0 but jumps over that page and looks for another page but if the bit is 0 the page will be removed.
The idea is that the heavy used page in the table will not get out. But in the extreme case when all pages are in heavy use the algorithm will cycle through all the pages setting their bits to zero before finding the page to remove. If it might not find the page to replace, and the bit was set again while it was looking through the others, in which a case the paging system fails.
Q1. If the reference string is
7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3,
we have taken the physical memory of three frames, then solve by First Come First Serve Disk Scheduling Algorithm.
Page Fault = 10
Q34. Define Multilevel Queue Scheduling.
Ans. In this algorithm ready queue is partitioned into separate queue has its own scheduling algorithm.
Q1. Explain Fair Share Scheduling.
Ans. Solaris 9 introduced two new classes of scheduling:
- Fixed Priority
- Fair Share
Threads in fixed priority class have the same priority range as in time sharing system.
Fair Share Scheduling class uses CPU share instead of priorities to make scheduling decisions. CPU share indicates right to available CPU resources and are allocated to a set of processes (known as project).
Q3. What are the scheduling techniques used by Multilevel Feedback Queue Scheduling Algorithm?
Ans. The scheduling technique used by Multilevel Feedback Queue Scheduling Algorithm is:
- A new job enters queue Q0 that is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q1.
- At Q1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q2.
- Several queues arranged in some priority order.
- Each queue could have a different scheduling discipline/ time quantum.
Figure: Multilevel Feedback Queue Scheduling
Q2. What are the parameters of Multilevel Feedback Queue Scheduler?
Ans. Multilevel feedback queue scheduler defined by the following parameters:
- Number of queues.
- Scheduling algorithm for each queue.
- Method used to determine when to upgrade a process.
- Method used to determine when to denote a process.
- Method used to determine which queue a process will enter when that process needs service.
Q1. Explain Multilevel Feedback Queue Scheduling.
Ans. Before multilevel feedback scheduling algorithm, we used only multilevel scheduling algorithm which was not so flexible, but this one uses separate queue for handling the processes, it automatically adjust the priority of the process. If the priority is high and the process will be allotted to lower priority queue, then automatically it can switch to the higher priority queue.
One queue may implement round robin algorithm the other may use first come fir serve algorithm, the allocation is based on the type of process, and that is, the process is either of CPU bound to I/O bound etc.
This type of scheduling allows the process to move between the various queues. The idea is to implement aging. The process that takes too much CPU time is assigned with lower priority queues, in addition to the process that waits too long for processing and is assigned to higher priority queues.