Answer:
Algorith does not work.
Step-by-step explanation:
One of the ways to obtain the Dekker Algorithm is through a change in the declaration, that is, a declaration that can be executed at the exact moment it leaves the critical section. This way it is possible that the statement,
turn = 1-i / * P0 sets turn to 1 and P1 sets turn 0 * /
It can be changed to,
turn = (turn +1) \% n / * n = number or processes * /
The result will allow to define if it works or not, that is, if it is greater than 2 the algorithm will not be able to work.
Given this consideration we can say that,
- The dead lock does not occur, because the mutual is imposed (if a resource unit has been assigned to a process, then no other process can access that resource).
- There is the possibility of starving if the shift is established in a non-contentious process.
Directly it can be concluded that there is a possibility of starvation so the algorithm could not work, despite the fact that mutual exclusion guarantees that a dead block does not occur.