Hung_Nguyen_HA6

.docx

School

George Mason University *

*We aren’t endorsed by this school

Course

342

Subject

Industrial Engineering

Date

Feb 20, 2024

Type

docx

Pages

3

Uploaded by hungnguyen090600

Report
Scheduling Algorithms Part 1 First Come First Serve Consider the following processes along with their burst time (in Calculate the average waiting time if the processes arrive in the following order Process Burst Time in Ms P1 20 P2 10 P3 5 Calculate the average waiting time if the processes arrive in the following order (i)P1, P2, P3 (ii)P2, P3, P1 (i) Case 1:  Consider a case if processes P1, P2, P3 arrive  at the same time  say 0 ms in the system in the order P1, P2, P3. The arrival of processes is represented in the Gantt chart as shown below. Gantt chart P1 P2 P3 20 30 35 Process Waiting Time Turnaround Time P1 0 20 P2 20 30 P3 30 35 Therefore, average waiting time = (0+20+30)/3 ms = 16.67 ms The average waiting time is 16.67 ms. Turnaround Time = (20+30+35)/3 ms = 28.33 ms
The average turnaround time is 28.33 ms. Case 2: Processes arrive in order P1, P2, P3, let us assume at 0 ms, 2 ms and 4 ms, respectively. Arrival Time :   Time   at which the process arrives in the ready queue. Process Burst Time Arrival Time P1 20 0 P2 10 2 P3 5 4 Gantt chart: Draw the Gantt Chart 0 2 4 P1 P2 P3 ----------------------------------- 20 ------------------------------------------------------ 30 ------------------------------------------------------------------- 35 Waiting time for process P1 = 0 ms Waiting time for process P2 = 20 ms – 2 ms = 18 ms Waiting time for process P3 = 30 ms- 4 ms = 26 ms Calculate the average waiting time (0+18+26)/3 = 14.67 ms The average waiting time is 14.67 ms. Calculate the Turnaround Time Turnaround time = exit time – arrival time Turn around for process P1 = 20 – 0 = 20 ms Turn around for process P2 = 30 – 2 = 28 ms Turn around for process P3 = 35 – 4 = 31 ms (20+28+31)/3 = 26.33 ms The average time for turnaround time is 26.33 ms.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help