Question

In: Computer Science

Explain RR scheduling uses preemption and priorities. (b) Does RR scheduling use multiple classes of processes?...

Explain RR scheduling uses preemption and priorities. (b) Does RR scheduling use multiple classes of processes? Why? Explain.

Solutions

Expert Solution

RR scheduling uses preemption and priorities:

In the Pre-emptive category of scheduling algorithms, a process which is allocated to the processor can be stopped and the running state of the corresponding process is changes to waiting state.Suspending the processes that are logically runnable is called Preemptive Scheduling. The resources are allocated to a process for a partial time. Process can be interrupted in between.

The RR algorithm provides equal chance of execution to all the processes in the process set.The RR algorithm does not consider the priorities of the processes which can be considered as the major drawback. RR scheduling uses preemption and priorities overcome this limitation of RR algorithm.

This algorithm categorizes the processes as High priority processes and low priority processes. The proposed scheme reduces the average waiting time of high priority process irrespective of the low priority process. The overall average waiting time will change according to the set of processes considered.

Step 1: Enter process name, priority and burst time.

Step 2: Store the above details in a queue called READYQ

Step 3: Create two separate queues, first HIGHPQ for high priority processes and second LOWPQ for normal priority processes.

Step 4: Do step 5 to step 11 until remaining CPU burst time of processes of both the queues (HIGHPQ and LOWPQ) become zero.

Step 5: Select next process from either HIGHPQ or LOWPQ on alternate basis. First, a process form HIGHPQ must be selected as it should get priority over normal priority processes.

Step 6: If the remaining CPU burst time of selected process is greater than or equal to time quantum then do step 7, otherwise do step 8.

Step 7: Execute that process for duration of time quantum.

Step 8: Execute the selected process until its remaining burst time become zero.

Step 9: Update the remaining CPU burst time of the respective process in respective queue.

Step 10: Store the IN-TIME and OUT-TIME of the process into a table GANTTCHART.

Step 11: If above process has selected from HIGHPQ then swap the next turn to LOWPQ and vice versa.


Example:

Process Name Priority Burst Time

P0 0 5

P1 1     3

P2 1   12

P3 0 9

P4 0 8

HIGHPQ: This queue contains the processes of high priority.

Process Name Priority Burst Time

P1 1 3

P2 1 12

LOWQPQ: This queue contains the processes of low priority.

Process Name Priority Burst Time

P0 0 5

P3 0 9

P4 0 8

A process from high priority queue is selected first then next process is selected from low priority queue

The Gantt chart for the processes with time quantum 4 is

Process In time Out time   

P1 0 3

P0 3 7

P2 7 11

P3 11 15

P2 15    19

P4   19 23

P2 23 27

P0 27 28

P3 28 32

P4 32   36

P3 36 37

The waiting time for the processes is

Process PR WT

P0 0 23

P1   1 0

P2   1 15

P3   0 28

P4 0 28

RR scheduling does not use multiple classes of processes because it is a time sharing algorithm .


Related Solutions

First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling Priority Scheduling Shortest Remaining Time Round Robin(RR) Scheduling Multiple-Level...
First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling Priority Scheduling Shortest Remaining Time Round Robin(RR) Scheduling Multiple-Level Queues Scheduling Provide a timing example of each of the algorithms above. List some processes (at least four) with the appropriate properties for creating a time diagram (such as Process ID, Arrival Time, Burst Time, and Execution Time). Walk through the timing diagram identifying the algorithm you’re using and state which process goes first, which process finishes first, etc.
When scheduling processes on multiple cores, which is the following is not a valid state- ment?...
When scheduling processes on multiple cores, which is the following is not a valid state- ment? Having a run queue per core reduces contention Scheduling affinity (keeping a process executing on the same core) promotes good cache perfor- mance Work stealing is when work owned by a particular core is illicitly taken by another core without permission Which of the following is not a valid transition between process states? A process that is waiting for I/O can be dispatched and...
True or false 1) OS uses multiple queues in process scheduling. At any time instance, the...
True or false 1) OS uses multiple queues in process scheduling. At any time instance, the PCB of a process can only belong to one queue. 2)OS uses the \proc pseudo-file system to store the statistical information of a process. Even if a process is terminated, we can still find the statistical information on of this process from the \proc pseudo-file system. 3) When a process successfully calls an exec*() function to run a program, the executed program will inherit...
Explain the main disadvantage of scheduling with preemption. (b) Describe and explain an example. (c) Is...
Explain the main disadvantage of scheduling with preemption. (b) Describe and explain an example. (c) Is the Five Philosophers Problem a synchronization problem? Explain.
Part 6.   Question 10. [ Use Video-1 under Scheduling heading. ] An organization that continuously processes...
Part 6.   Question 10. [ Use Video-1 under Scheduling heading. ] An organization that continuously processes proposals is addressing a large backlog due to an historical FIFO sequencing rule. You have been asked to determine a schedule that minimizes the processing time of project proposals through the editing department and revision department. The editing department identifies changes and the revision department incorporates the changes and produces a final proposal document for release. A proposal must pass through each department. Each...
Question 2: a) Explain what is meant by “shares” and “classes of shares”. Use examples to...
Question 2: a) Explain what is meant by “shares” and “classes of shares”. Use examples to support your answer. b) A company has 80% ordinary shareholder and 20% preference shareholders. The company would like to change the amount of dividend received for the preference shareholders. How can the rights of the preference shareholders be changed? As part of your answer, explain the voting procedure for the given situation. PLEASE DO NOT COPY AND PASTE.
Multiple Choice/ Arduino Review -The Arduino uses what to assign analog values? a. Sine waves b....
Multiple Choice/ Arduino Review -The Arduino uses what to assign analog values? a. Sine waves b. PWM c. Square Waves d. Both b and c - Which Of the following is NOT an example Of a standard Arduino library? a. Servo b. TFT c. LiquidCrystal d. Thermo - The Arduino language is based on what? a. Python b. Java c. C/C++ d. HTML - How many channels of A/D conversion does the Arduino Uno have? a. 6 b. 13 c....
a)Explain the economic cycle concept "growth cycle". When does a product gap? b) Use a Keynesian...
a)Explain the economic cycle concept "growth cycle". When does a product gap? b) Use a Keynesian cross to show what happens in the case of an autonomous Planned macroeconomic spending is falling. c) Explain how the economy is adapting to a new income-expenditure adapts weight.
b) Explain the purposes of the t test and the F test in multiple regression. d)...
b) Explain the purposes of the t test and the F test in multiple regression. d) When can we experience autocorrelation in our data and how do we determine whether there is a first-order correlation (Explain)?
Briefly explain the different processes to use as a base for examining a project. Choose one...
Briefly explain the different processes to use as a base for examining a project. Choose one of these processes, and explain why it would be the most effective for 'Project Infiltration'. Name and discuss the seven [7] strategies for reducing project time. Choose one strategy, and apply it in 'Project Infiltration'. Explain the process you used to do this application. Discuss the four [4] steps to install a time control system, and illustrate this in 'Project Infiltration'. Based on the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT