ambreenjava Posted September 17, 2003 Share Posted September 17, 2003 Q) Five jobs are waiting to be run. Their expected run times are 9,6,3,5, X. In what order should they be run to minimize average response time. I think it should be like A = 9 B = 6 C = 3 D = 5 X = ? now if they are scheduled this way CDBAX then Process Response Time C 0 D 3 B 8 A 17 X 25 and avg response time would be 5.2 units Is that okay? Quote Link to comment Share on other sites More sharing options...
wood Posted September 17, 2003 Share Posted September 17, 2003 Shortest Job First always produces the minimum average response time. So, for all the cases of X, here are the answers: X 3 5 6 X > 9: C D B A X You don't know how much X is, so you can't calculate the average response time. Quote Link to comment Share on other sites More sharing options...
romanrostov666 Posted September 18, 2003 Share Posted September 18, 2003 why does Shortest Job always produce the minimum average response time? i thought it doesn't make a difference which job should be sent first? Quote Link to comment Share on other sites More sharing options...
wood Posted September 18, 2003 Share Posted September 18, 2003 Explanation: Take a, b, c, and d. The first job finishes at time a, the second finishes at time a+b, and so on. The mean turnaround time is (4a + 3b + 2c + d)/4. It is clear that a contributes more to the average than the other times, so it should be the shortest job, with b next, then c and finally d as the longest as it affects only its own turnaround time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.