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

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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. 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’ssynchronization....
View Full Document

This note was uploaded on 12/29/2009 for the course INFO ENGI 9801 taught by Professor Wu during the Spring '09 term at 東京国際大学.

Page1 / 9

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online