Midterm-Solution

Midterm-Solution - Sample Solutions to Midterm Quiz Part I...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Sample Solutions to Midterm Quiz Part I MC and T/F Questions (15 points) 1 2 3 4 5 6 7 8 9 10 C F D T F A F T B F 11 12 13 14 15 T C T D D Part II Short Questions (20 points ) Question 1 (4 points) The main cause of starvation (indefinite postponement) is due to the use of priority policy in the scheduling algorithms. A high priority process will always run before a low priority process. If there always have high priority processes (comes and goes), the low priority processes will never be scheduled they will experience starvation. For the above scheduling algorithms, only SPF and MLFQ may suffer with starvation as they have the priority policy in used; while FIFO and RR do not have the starvation issue as all processes are scheduled as according to their arrival order. Question 2 (4 points) (a) We should obtain x = 6 only in both processes as the variable x is not shared by the two processes. (b) The value of x could be of any value between 6 and 12 (i.e., [6, 12]. This is a classical example of race condition as the two threads try to update the shared variable x without protection.
Image of page 1
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