# Deadlock vs “Progress” requirement of the solution to the critical section problem

I came across following problem:

Consider following code:

𝚠𝚑𝚒𝚕𝚎(𝟷)
{
𝚏𝚕𝚊𝚐[𝚒] = 𝚝𝚛𝚞𝚎;
𝚠𝚑𝚒𝚕𝚎(𝚏𝚕𝚊𝚐[𝚓]);
/* 𝙲𝚛𝚒𝚝𝚒𝚌𝚊𝚕 𝚜𝚎𝚌𝚝𝚒𝚘𝚗 */
𝚏𝚕𝚊𝚐[𝚒] = 𝚏𝚊𝚕𝚜𝚎;
/*𝚁𝚎𝚖𝚊𝚒𝚗𝚍𝚎𝚛 𝚜𝚎𝚌𝚝𝚒𝚘𝚗 */
}


Let flag is declared as Boolean flag[2] and Pi denote one process while Pj denotes other process and i=1-j. Both processes execute concurrently, then does the progress requirement of the solution to the critical section problem satisfied in the above case?

Doubt

The solution says that both processes Pi and Pj can simultaneously execute flag[i]=true and then both may busy wait on while(flag[j]), thus leading to deadlock and hence progress requirement of the solution to the critical section problem is not satisfied.

I know the normal / day to day meaning of "progress" gives us feeling that if there can be deadlock, then there may not be the progress. But Galvin's book defines "Progress" as this:

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 can participate in deciding which will enter its critical section next, and this selection cannot be postponed indefinitely.

So I am guessing whether progress has anything to do with deadlock. And whether the code indeed satisfies progress requirement of critical section problem.