-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid re-using register in ticketlock #514
Conversation
Signed-off-by: Hernan Ponce de Leon <hernanl.leon@huawei.com>
Signed-off-by: Hernan Ponce de Leon <hernanl.leon@huawei.com>
I don't really see a big difference in the new and the old code. In both cases, |
You are right that the first two conditions are trivially satisfied. I now know what confused me. Initially I only had the conditions about the critical sections and even the correct code was failing. This is because one thread could acquire the lock and the other fails. Since the initial code of registers matches what I was expecting not to be read from I added these extra conditions to try to force that each lock acquire succeeds (this could also be solved if the initial value of I will update this. |
Signed-off-by: Hernan Ponce de Leon <hernanl.leon@huawei.com>
I see. I think this is because we evaluate litmus assertions even for executions that do not terminate properly. |
That is orthogonal to the changes in here. I'll tackle that problem in a different PR. |
Of course. You can go ahead and merge. |
The idea of the final condition is to check that each lock reads a different ticket. While I think in a correct implementation, we would still check
original-read-r1-T0 + != original-read-r1-T1
, I don't think this is guaranteed if the mutual exclusion does not hold.This PR solves the issue by simply using a fresh register for the release store.