なじみのない方のために説明すると、プロセス調整に使用される Peterson のアルゴリズムは次のとおりです。
int No_Of_Processes; // Number of processes
int turn; // Whose turn is it?
int interested[No_Of_Processes]; // All values initially FALSE
void enter_region(int process) {
int other; // number of the other process
other = 1 - process; // the opposite process
interested[process] = TRUE; // this process is interested
turn = process; // set flag
while(turn == process && interested[other] == TRUE); // wait
}
void leave_region(int process) {
interested[process] = FALSE; // process leaves critical region
}
私の質問は、このアルゴリズムがデッドロックを引き起こす可能性があるかどうかです。