{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

os04-2nd - Operating Systems 2nd Exam for 2002 Fall...

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

View Full Document Right Arrow Icon
Operating Systems 2nd Exam. for 2002 Fall Semester Date: Dec-01-2004, Time: 1:10 p.m.-2:40 p.m. Name: Student ID: Dept: There are 12 problems in this examination. The weight for each problem is indicated at each problem. Just write your answer on the blank space following each problem. 1. A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait and signal . These operations were originally termed P (for wait ) and V (for signal ). (a) (4%)Although under the classical definition of semaphores with busy waiting the semaphore value is never negative, the implementation may have negative semaphore values, which indicates the number of processes waiting on that semaphore. Please implement semaphores under this definition as a “C” structure and associated wait and signal semaphore operations. (b) (4%)Show that, if the wait(S) and signal(S) operations are not executed atomically, then mutual exclusion may be violated.
Background image of page 1

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

View Full Document Right Arrow Icon
2 2. Answer the following problems: (a) (4%) Why we have to guard against race condition and synchronize the critical section ? (b) (4%)A solution to the critical-section problem must satisfy the fol- lowing three requirements: mutual exclusion, progress, and bounded waiting. Please justify whether the following algorithm for the struc- ture of process P i satisfies these three requirements for two-process synchronization. Your answer must explicitly prove each condition’s
Background 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 ]}