Computer Sciences > Gate 2016 Set-1 > Code
Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than anyof its arguments. For all i, t[i] is initialized to zero.

Code for Pi
:
do {
    c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0;
    for every j 6= i in {0,...,n-1} {
        while (c[j]);
        while (t[j] != 0 && t[j]<=t[i]);
    }
    Critical Section;
    t[i]=0;
    Remainder Section;
    } while (true);



Which one of the following is TRUE about the above solution?
A
At most one process can be in the critical section at any time
B
The bounded wait condition is satisfied
C
The progress condition is satisfied
D
It cannot cause a deadlock

Correct : Code

Similar Questions

A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ
Choose the word that is opposite in meaning to the word “coherent”.
#5 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......