This is my new post linked with my previous post.
Is bounded waiting satisfied in the 2 Process Solution?
The answer in that post was very useful and cleared many concepts, but I just want to apply that answer for this example, that how BW works here .
Especially, I want to know this definition works for this example.
Define $k$-bounded waiting for a given mutual exclusion algorithm to mean that if $D_A^j \to D_B^l$ then $CS_A^{j} \to CS_B^{l+k}$.
Here, the Question comes
What can be said bout the Bounded Waiting of this 2 process solution"
<------- P1 ------->
While(True)
{
acquire(lock1)
acquire(lock2)
withdraw(from, amount)
deposit(to, amount)
release(lock2)
release(lock1)
}
<-------- P2 -------->
While(True)
{
acquire(lock1)
acquire(lock2)
withdraw(from, amount)
deposit(to, amount)
release(lock2)
release(lock1)
}