Good Morning People
I try to resolve this exercise nine of the chapter two
Exercise 9:Define r-bounded waiting for a given mutual exclusion algorithm to mean that if
.Is there a way for the peterson algorithm such that it provides r-bounde waiting for some value of r?
and i have a doubt:
peterson algorithms for n=2 is bounded waiting ?
I try this answer:
Recalling that we can consider r as bounded waiting: D equal to input plug when the thread enters the barrier to entry and bounded waiting is my upper limit, but the lower limit r = 0.Then if D aj -> Dbk
then CSja
-> CSB K+R we say that k-th Passagen b for its anteroom precedes the jth pass along your anteroom then the critical region of b precedes the critical region b.
Basically bounded waiting would be my notion of justice in a mutual exclusion algorithm and the notion of justice is an upper limit that means as I hope, from what I demonstrated my interest. To issso I split munha entry barrier (lock) into two parts: Doorway in d waiting, and in the doorway I define a certain r bounded waiting that can be demonstrated: CSaj
-> CSBk+r
The r b means that the thread will not wait more than j + r to enter the critical region now answering the question of the year we can say that the algorithm Peterson, MS does not suffer from starvation he has no justice, because it is not even r bounded. One of the two threads can overcome the other and enter the critical section many times as you want, there is nothing in the algorithm that guarantees justiça.O to do to solve the problem of justice, here comes the notion of time (using timestamp).
but i like discuss about this exercise
someone for discuss?
thanks