oblem: Write a program to simulate the work of processes scheduler by using RR algorithm. The program should have three classes which are: 1. Process Class: This class represents the process where it has process id, execute time and completion time. Arrival is assumed to be zero all times. Process id should be unique and the class create it for each process. Provide the required methods accordingly. 2. RRSchedule Class: This class represents the work of the scheduler. It has mainly two lists of processes, quantum size, and clock. One of the list will be as a record of the processes while the other is to work on to execute the process in CPU. The clock should be a simple counter to represent timing to run the list of processes. The method list should be as following: a. Pop method: to remove the proces

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem:
Write a program to simulate the work of processes scheduler by using RR algorithm. The
program should have three classes which are:
1. Process Class: This class represents the process where it has process id, execute
time and completion time. Arrival is assumed to be zero all times. Process id should
be unique and the class create it for each process. Provide the required methods
accordingly.
2. RRSchedule Class: This class represents the work of the scheduler. It has mainly
two lists of processes, quantum size, and clock. One of the list will be as a record
of the processes while the other is to work on to execute the process in CPU. The
clock should be a simple counter to represent timing to run the list of processes.
The method list should be as following:
a. Pop method: to remove the process from the top of the list.
b. Push method: to insert the processes at the end of list after it is interrupted
and still has to go to CPU again.
c. RunRR method: to represent the job of RR scheduler. You may need to
add more methods to serve/help this method.

O COMP2202_SP2022_HW2_Proble x
+
A elearn.squ.edu.om/pluginfile.php/1669149/mod_resource/content/0/COMP2202_SP2022_HW2_Problem_Updated.pdf
COMP2202_SP2022_HW2_Problem
2 / 5
5 |
100% +| 0 0
The scheduling will work as following:
P,
P2
P3
P,
P,
P,
P,
P,
0 4 7 10
14
18
22
26
30
Therefore, P, needs 24/4=6 slots to execute in CPU where each slot is 4 ms. However, P2
and P3 needs one slot each.
Operation system scheduler can be evaluated by turnaround time and waiting time.
Turnaround time is the amount of time to execute a particular process which can be
calculated as following:
turnaround time=completion time – arrival time
The waiting time is the amount of time a process has been waiting to get CPU which can
be calculated as following:
waiting time= turnaround time – execution time
According to the information above turnaround time and waiting time can be calculated
for each process as below (time measured in ms):
Execution
Waiting
time
Process
Arrival
Completion
time
Turnaround
time
time
time
P1
24
30
30
P2
3
7
4
P3
3
10
10
7
Problem:
© COMP2202_SP202.pdf
© Lab7.pdf
© HW1_COMP2002_.pdf
Inagene Branding.jpg
Rebranding for Be.jpg
Show all
9:22 PM
O Type here to search
[]
民
3/8/2022
Hi
IJ
Ai
80°F
4) ENG
出
Transcribed Image Text:O COMP2202_SP2022_HW2_Proble x + A elearn.squ.edu.om/pluginfile.php/1669149/mod_resource/content/0/COMP2202_SP2022_HW2_Problem_Updated.pdf COMP2202_SP2022_HW2_Problem 2 / 5 5 | 100% +| 0 0 The scheduling will work as following: P, P2 P3 P, P, P, P, P, 0 4 7 10 14 18 22 26 30 Therefore, P, needs 24/4=6 slots to execute in CPU where each slot is 4 ms. However, P2 and P3 needs one slot each. Operation system scheduler can be evaluated by turnaround time and waiting time. Turnaround time is the amount of time to execute a particular process which can be calculated as following: turnaround time=completion time – arrival time The waiting time is the amount of time a process has been waiting to get CPU which can be calculated as following: waiting time= turnaround time – execution time According to the information above turnaround time and waiting time can be calculated for each process as below (time measured in ms): Execution Waiting time Process Arrival Completion time Turnaround time time time P1 24 30 30 P2 3 7 4 P3 3 10 10 7 Problem: © COMP2202_SP202.pdf © Lab7.pdf © HW1_COMP2002_.pdf Inagene Branding.jpg Rebranding for Be.jpg Show all 9:22 PM O Type here to search [] 民 3/8/2022 Hi IJ Ai 80°F 4) ENG 出
O COMP2202_SP2022_HW2_Proble x
+
A elearn.squ.edu.om/pluginfile.php/1669149/mod_resource/content/0/COMP2202_SP2022_HW2_Problem_Updated.pdf
COMP2202_SP2022_HW2_Problem
1 /5 |
100% + | B O
Introduction:
In computing, Operating System(OS) is a system software that manage the work between
software (e.g. applications) and hardware(keyboard, screen, ..etc.). Examples of OS,
Windows, Linux, MAC, IOS, and Android. OS can manage the CPU work by providing
processes scheduler that decides which process should run in CPU at certain time. Process
can be any active running program/application on your computing device. For example,
you can access in parallel MS Word and browsing internet, and compiling your code in
NetBeans. Each application is a process and need CPU to execute/run it.
Round-Robin(RR) algorithm is used as processes scheduling in OSs. Each process is given
an equal time slot (quantum ) to run in the CPU then it is interrupted in circular order'.
Therefore,
the number of slots for a processes i = total execution time of processes i / quantum length
Suppose that the processes arrive at time 0 milliseconds(ms) in the order: P1, P2 , P; as in
the following table with execution time of each process and the quantum time is 4 ms.
Process name
Execution time
Po
24
P2
3
'Read More: https://en.wikipedia.org/wiki/Round-robin_scheduling
1|
© COMP2202_SP202.pdf
G Lab7.pdf
© HW1_COMP2002_.pdf
D Inagene Branding.jpg
O Rebranding for Be.jpg
Show all
9:22 PM
O Type here to search
[]
民
3/8/2022
IJ
Ai
80°F
4) ENG
近
出
Transcribed Image Text:O COMP2202_SP2022_HW2_Proble x + A elearn.squ.edu.om/pluginfile.php/1669149/mod_resource/content/0/COMP2202_SP2022_HW2_Problem_Updated.pdf COMP2202_SP2022_HW2_Problem 1 /5 | 100% + | B O Introduction: In computing, Operating System(OS) is a system software that manage the work between software (e.g. applications) and hardware(keyboard, screen, ..etc.). Examples of OS, Windows, Linux, MAC, IOS, and Android. OS can manage the CPU work by providing processes scheduler that decides which process should run in CPU at certain time. Process can be any active running program/application on your computing device. For example, you can access in parallel MS Word and browsing internet, and compiling your code in NetBeans. Each application is a process and need CPU to execute/run it. Round-Robin(RR) algorithm is used as processes scheduling in OSs. Each process is given an equal time slot (quantum ) to run in the CPU then it is interrupted in circular order'. Therefore, the number of slots for a processes i = total execution time of processes i / quantum length Suppose that the processes arrive at time 0 milliseconds(ms) in the order: P1, P2 , P; as in the following table with execution time of each process and the quantum time is 4 ms. Process name Execution time Po 24 P2 3 'Read More: https://en.wikipedia.org/wiki/Round-robin_scheduling 1| © COMP2202_SP202.pdf G Lab7.pdf © HW1_COMP2002_.pdf D Inagene Branding.jpg O Rebranding for Be.jpg Show all 9:22 PM O Type here to search [] 民 3/8/2022 IJ Ai 80°F 4) ENG 近 出
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY