Fa99 midterm-solutions - This are very quick solutions I...

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

This are very quick solutions I came up with. I do not guarantee they are correct, but they should be close. If you find possible errors, feel free to post to the newsgroup. Question 1: Here are the possible sequences: (x,y) a,f,b,c,d,e,g,h,i,j = (0,2) a,f,g,h,i,j,b,c,d,e = (2,3) f,a,b,c,d,e,g,h,i,j = (2,0) f,a,g,h,i,j,b,c,d,e = (2,1) a,b,c,d,e,f,g,h,i,j = (4,0) note, you can have cases like: f,g,h,i,a,j,b,c,d,e but they turn out to be redundant (the x,y pair has already been shown) Question 2: FIFO Time 0 5 10 15 20 #1 ********** = done at 5 #2 ****** = done at 8 #3 ************ = done at 14 #4 *** = done at 15.5 average run time = 5 + 7 + 12 + 12.5 = 36.5 /4 = 9 RR assuming that when a task is done, it is put at the end of the ready queue also, when a process arrives, it is put at the end of the queue, and in fact, is put after the one that is running during the time slot it arrived in. ok, I think this is right, but it might be off by a little.. it's hard to keep track of all this info.. Time 0 5 10 15 20 #1 *** * * * * * * * = done at 12.5 #2 * * * * * * = done at 10.5 #3 * * * * * * ****** = done at 15.5 #4 * * * = done at 9 average run time = (12.5 + 9.5 + 13.5 + 6)/4 = 10.4 STCF Time 0 5 10 15 20 #1 ********** = done at 5
Image of page 1

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

#2 ****** = done at 9.5 #3 ************ = done at 15.5 #4 *** = done at 6.5 average run time = (5 + 8.5 + 13.5 + 3.5)/4 = 7.6 SRTCF Time 0 5 10 15 20 #1 ** ******** = done at 9.5 #2 ****** = done at 4 #3 ************ = done at 15.5 #4 *** = done at 5.5 average run time = (9.5 + 3 + 13.5 + 2.5)/4 = 7.1 SET Time 0 5 10 15 20 #1 ** * * * * * * * * = done at 14 #2 ** * * * * = done at 10 #3 ** * * * * * * * *** = done at 15.5 #4 ** * = done at 6 average run time = (14 + 9 + 13.5 + 6 )/4 = 10.6 Question 3: A program is merely a series of instructions.. A process is a program being run... it has a state (where it is currently executing, what the values of the memory locations are, and so on) Question 4: Total X currently held by all: 9 Total Y currently held by all: 15 Let's see how we could order the threads to proceed There is 1 unit of X left and 5 units of Y.
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