12.07.2015 Views

CS 440 Assignment 5

CS 440 Assignment 5

CS 440 Assignment 5

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Student: ****Instructor: Dr. John WangDue date: ****<strong>CS</strong> <strong>440</strong> <strong>Assignment</strong> 53. Assume you have the following jobs to execute with one processor, with the jobsarriving in the order listed here:i (p i )0 801 202 103 204 50a. Suppose a system uses FCFS scheduling. Create a Gantt chart illustrating theexecution of these processes.T TRnd --0 80 100 110 130 180P 0 P 1 P 2 P 3 P 40 80 20 10 20 50b. What is the turnaround time for process p 3 ?T TRnd (P 3 ) = (P 3 ) + T TRnd (P 2 ) = 20 + 110 = 130c. What is the average wait time for the processes?W avg = (W(P 0 ) + W(P 1 ) + W(P 2 ) + W(P 3 ) + W(P 4 )) / 5= (0 + 80 + 100 + 110 + 130) / 5= 420/5= 84.4. Using the process load in the previous problem, suppose a system uses SJNscheduling.a. Create a Gantt chart illustrating the execution of these processes.T TRnd --0 10 30 50 100 180P 2 P 1 P 3 P 4 P 00 10 20 20 50 80b. What is the turnaround time for process P 4 ?T TRnd (P 4 ) = (P 4 ) + T TRnd (P 3 ) = 50 + 50 = 100c. What is the average wait time for the processes?W avg = (W(P 0 ) + W(P 1 ) + W(P 2 ) + W(P 3 ) + W(P 4 )) / 5= (100 + 10 + 0 + 30 + 50) / 5= 190/5= 38.


W avg = ((W(P 0 ) – Arrival Time(P 0 )) + (W(P 1 ) - Arrival Time(P 1 ) ) +(W(P 2 ) - Arrival Time(P 2 )) + (W(P 3 ) - Arrival Time(P 3 )) + (W(P 4 )- Arrival Time(P 4 ))) / 5= ((0 - 0)+ (15 – 10) + (30 – 10) + (85 – 80) + (100 – 85)) / 5= 45/5= 9.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!