written 5.6 years ago by | modified 5.6 years ago by |
Ricart - Agarwala s a non token based algorithm that uses broadcast technique for mutual calculation.
Consider a scenario when process PO & P1 went to enter critical sector. Both P0 & P1 send broadcast to all 3 processes in the system along with time stamp.
Since P2 does not want to enter critical section hence it sends "OK" to both the processes.
Since P1 finds Ts of P0 to be lesser than Ts of self therefore P1 sends to P0.
Now P0 can enter critical section, as it is received (n-1) OK messages.
Once P0 is done with critical section, it sends "Ok" message to P1.
Now P1 can enter CS.
One of the problem with this algorithm is that once a process P1 receives "OK" from all (n-1) processes, it can enter CS subsequently without sending repeat message.
Secondly if the node having process fails then all other processes stare forever. this can be solved by detecting failure of nodes.