Operating System Concepts, Seventh Edition

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS162 Fall 2002, Midterm One Solutions: mean: 61.71 Standard Deviation:11.76 ******************************************************************** Problem 1 (David Marin): ******************************************************************** - One of the biggest pitfalls was to confuse what is important about a job being "short" or "long". To minimize flow time, we want to run jobs that we can kick out of the system quickly; i.e. jobs with the smallest _remaining_ processing time; we don't care about their _total_ running time. SET only works because in most real systems, elapsed time is a good way of predicting remaining processing time. - A "realizable" algorithm means an algorithm you can actually implement (i.e. make real). SRPT and SJF, for instance, are not realizable unless you know the total running time of a job in advance. Several people apparently missed or didn't understand this word. If you ever don't understand a word on the test, and it appears to be important ("realizable" appears 8 times!) please ask one of the TAs. - This was the first problem on the test, and Professor Smith didn't announce until about halfway through that he only cared about minimizing average flow time (though from class, you should remember that average flow time is the most important metric of a scheduling algorithm). So I was willing to give partial or even full credit to solutions that (correctly) discussed the tradeoffs (e.g. lower flow time, but less variance) rather than just giving a ranking. - Smith also announced "no overhead" during the test. I didn't ever take off points for mentioning overhead, but I wouldn't give full credit for solutions that arrived at a different answer because of overhead (you can't make this judgment without knowing how much overhead there is). part a: Solution: >From best to worst, the algorithms are: SRPT, FCFS, RR, SET SRPT _always_ has the smallest average flow time. RR and SET will be alternating through all the jobs; since all jobs are about the same length, it will take a long time before any job leaves the system. FCFS will at least stick with the current job, and kick _it_ out, so it beats RR and SET. Why is RR better than SET? RR puts new jobs in the back of the queue, so currently running jobs at least get a little bit more of a chance to complete. SET will constantly be interrupting currently running jobs (that may have almost finished) with new jobs. Scoring: - 4 points for correct answer (-1 for each algorithm in the wrong
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
place in the ranking) - 3 points for explanation usually get all 3 points) (2 points total for blank) Some people didn't rank RR and SET (they just said, SRPT good, FCFS average, RR&SET bad). You could do this and still get all 7 points (they both suck, and for pretty much the same reason). Ranking them _wrong_ would lose a point. If you didn't write anything at all about RR, you could get at 5 points. part b: Solution: SRPT isn't realizable (can't predict the that leaves FCFS as the best algorithm. future) so from part a, most (anything coherent and correct would One person came up with a different solution: to predict the remaining running time, take the amount of time that the job has run already (X), and subtract it from 10. If X > 10, take 12 - X instead. Then always run the job with the shortest
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern