1,429 views
0 votes
0 votes

Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain multiple processes and have two possibilities:

(I have came across many similar problems at other sources and there must be some more on gateoverflow also. Please find them and link them here in comments.)

All answers say that such deadlock and process termination result in halting progress and such code does not satisfy progress requirement. However I feel thats not the case. First of all consider the following code for Peterson’s solution from Galvin’s book:

do {
    flag [i] = TRUE;
    turn= j;
    while (flag[j] && turn==j);
    //critical section
    flag [i] = FALSE; 
    //remainder section
} while (TRUE);

Above, if any process terminates before setting flag[i] to FALSE, then the other process is blocked indefinitely. By scenario 2, even Peterson's algorithm does no satisfy progress requirement of the solution to the critical section problem. But Galvin's book says different and it goes on to prove how Peterson's solution satisfies progress requirement.

Also have a look at the definition of the progress requirement for the solution to the critical section problem from Galvin's book. It is defined in the book as follows:

If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing in their remainder sections (that is processes executing in their entry and exit section) can participate in the decision on which will enter its critical section next, and this selection cannot be postponed indefinitely.

This definition does not say anything about process termination and also about deadlock. 

I feel process termination and deadlock is not considered while evaluating whether given code satisfies progress requirement of the solution of the critical section problem. Am I right? And if yes, are all other solutions to all those problems incorrect? Or I am screwed up at my concepts?

 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
2 answers
3
shivajikobardan asked Jul 22, 2023
797 views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...