Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Faculty of Engineering & Technology Department of Electrical & Computer Engineering ENCS 3 3 9 0 : Operating System Concepts First Semester, 2 0 2

Faculty of Engineering & Technology
Department of Electrical & Computer Engineering
ENCS3390: Operating System Concepts
First Semester, 2023/2024
Programming Task 2
Published: Dec 6,2023. Due: Jan 2,2023 by midnight.
Consider the following set of processes:
Once each process is done processing its Burst Time, it goes to the waiting queue,
then Comes back to the ready queue after the time shown.
You are required to simulate the CPU schedule for a period of 200 time units.
For each of the following scheduling algorithms, your program must show the Gantt
chart, average waiting time, and average turnaround time.
1- First Come First Served.
2- Shortest Job First.
3- Shortest Remaining Time First.
4- Round Robin, with q =5
5- Preemptive Priority Scheduling, with aging; where priority is decremented by
1 if the process remains in the ready queue for 5 time units.
6- Non-preemptive Priority Scheduling, with aging; where priority is
decremented by 1 if the process remains in the ready queue for 5 time units.
For this assignment, you may use any programming language of your choosing.
Process Arrival Time Burst Time Comes back
after
Priority
P101023
P21842
P331463
P44781
P56530
P57461
P78692
Hint: You should create a process that initially creates the 7 processes, and
continuously updates the status of the processes, and another process that schedules
those processes, and plots the results.this the question and this is thw answer First Come First Served:
GANTT CHART:
0 P110 P218 P332 P439 P544 P648 P754 P164 P272 P386 P493 P5152 P6156 P7162 P1172 P2180 P3194 P4200
Average waiting time =127.286
Average turnaround time =169.571
Shortest Job First:
GANTT CHART:
0 P110 P614 P519 P725 P629 P534 P740 P644 P549 P755 P659 P564 P770 P674 P579 P785 P689 P594 P7100 P6104 P5109 P7115 P6119 P5124 P7130 P6134 P5139 P7145 P6149 P5154 P7160 P6164 P5169 P7175 P6179 P5184 P7190 P6194 P5199 P7200
Average waiting time =41.5
Average turnaround time =145.5
Shortest Remaining Time First:
GANTT CHART:
0 P11 P29 P613 P518 P719 P623 P728 P533 P637 P542 P743 P647 P752 D557 P661 P566 P767 P671 P776 P581 P685 P590 P791 P695 P7100 P5105 P6109 P5114 P7115 P6119 P7124 P5129 P6133 P5138 P7139 P6143 P7148 P5153 P6157 P5162 P7163 P6167 P7172 P5177 P6181 P5186 P7187 P6191 P7196 P5200
Average waiting time =35.4
Average turnaround time =115
Round Robin:
GANTT CHART:
0 P15 P210 P315 P420 P125 P530 P634 P739 P242 P347 P449 P154 P559 P760 P664 P269 P373 P178 P483 P588 P793 P296 P6100 P3105 P1110 P4112 P5117 P7118 P2123 P3128 P6132 P1137 P4142 P5147 P2150 P7155 P3159 P6163 P1168 P4170 P5175 P2180 P7181 P3186 P1191 P6195 P4200
Average waiting time =137.429
Average turnaround time =182.714
Priority Scheduling (Preemptive):
GANTT CHART:
0 P11 P24 P46 P511 P416 P117 P222 P323 P627 P728 P533 P134 P441 P342 P250 P751 P655 P156 P561 P362 P469 P773 P281 P182 P686 P387 P592 P499 P1100 P7106 P2114 P3115 P6116 P5121 P1122 P4129 P7135 P3136 P6139 P2147 P1148 P5153 P3154 P4161 P7162 P6166 P1167 P2168 P5173 P3174 P7175 P4176 P5181 P2188 P1189 P6193 P3194 P7195 P4196 P5200
Average waiting time =139.571
Average turnaround time =189.429
Priority Scheduling (Non-Preemptive):
GANTT CHART:
0 P110 P417 P225 P339 P544 P648 P754 P164 P471 P279 P393 P598 P6102 P7108 P1118 P4125 P213

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

L A -r- P[N]

Answered: 1 week ago