Does Peterson's algorithm satisfy starvation?

前端 未结 3 1270
心在旅途
心在旅途 2021-01-02 13:31

I\'ve been searching information on Peterson\'s algorithm but have come across references stating it does not satisfy starvation but only deadlock. Is this true? and if so c

3条回答
  •  鱼传尺愫
    2021-01-02 14:08

    I suspect the comment about starvation is about some generalized, N-process Peterson's Algorithm. It is possible to construct an N-process version with bounded waiting, but without having one in particular to discuss we can't say why that particular generalization might be subject to starvation.

    A quick Google turned up this paper which includes pseudocode. As you can see, the generalized version is much more complex (and expensive).

提交回复
热议问题