Peterson's mutual exclusion algorithm for two processes has been generalized to $N$ processes in various ways. As far as we know, no such generalization is starvation free without making any fairness assumptions. In this paper, we study the generalization of Peterson's algorithm to $N$ processes using a tournament tree. Using the mCRL2 language and toolset we prove that it is not starvation free unless weak fairness assumptions are incorporated. Inspired by the counterexample for starvation freedom, we propose a fair $N$-process generalization of Peterson's algorithm. We use model checking to show that our new algorithm is correct for small $N$. For arbitrary $N$, model checking is infeasible due to the state space explosion problem, and instead, we present a general proof that, for $N \geq 4$, when a process requests access to the critical section, other processes can enter first at most $(N-1)(N-2)$ times.
翻译:彼得森的两个过程的相互排斥算法已经以各种方式被普遍化为美元进程。 据我们所知,在不作任何公平假设的情况下,任何这种普遍化都不是没有饥饿的。 在本文中,我们研究了彼得森的算法是否普遍化为使用比赛树的美元进程。 使用 mCRL2 语言和工具,我们证明,除非将薄弱的公平假设纳入其中,否则它不是没有饥饿的。在饥荒自由反示例的启发下,我们提议对彼得森的算法采用公平的美元进程一般化。 我们用模型检查来显示我们的新算法对小额美元来说是正确的。 对于任意的美元,由于国家空间爆炸问题,模型检查是不可行的,相反,我们提出了一个一般性的证据,即对于 $\geq 4美元,当一个过程请求进入关键部分时,其他过程可以先输入最多$(N-1)(N-2)次。