A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. Processes P1 and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program.

get_exclusive_access ( ) { if (critical _flag == FALSE) { critical_flag = TRUE ; critical_region () ; critical_flag = FALSE; } }

Consider the following statements.
i. It is possible for both P1 and P2 to access critical_region concurrently.
ii. This may lead to a deadlock.
Which of the following holds?
a. (i) is false and (ii) is true
b. Both (i) and (ii) are false
c. (i) is true and (ii) is false
d. Both (i) and (ii) are true
Answer:(i) is true and (ii) is false
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: