100%(11)11 out of 11 people found this document helpful
This preview shows page 1 - 3 out of 6 pages.
Operating Systems, Exam 1Name:This exam is closed book and closed notes. Your work must be individual. Cheating willbe punished according to university academic integrity code.1Short AnswerGive a brief but complete answer to each of the following questions (7 pts each).1. Consider the following flawed solution to thecritical sectionproblem. Which of thethree requirements for a critical section solutions does this fail to satisfy?Brieflyexplain why.1
2. Pretend the following three functions will be run concurrently by three different threads.Add semaphore pseudocode to guarantee that functions Y() and Z() will never be per-mitted to execute at the same time and, for each iteration, the call to Y() will alwayscome after the call to X() has completed (i.e., theithcall to X() must return beforethe theithcall to Y() begins). Be sure to declare and initialize any semaphores youuse.