-
Notifications
You must be signed in to change notification settings - Fork 29
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
DRB189-barrier3-yes.c does not contain a data race #145
Comments
@LChenGit can you explain, why this code is marked as having a data race? The locking pattern really looks like in DRB186-barrier2-no.c. Thread 0 cannot pass until Thread 1 releases l1 and Thread 1 cannot pass until Thread 0 releases l0. In addition, the code would have way more data race pairs than listed - if the barrier would not synchronize. Both threads read x in lines 99 and 106. |
Ok, as soon as thread 0 releases l0, thread 1 can run through multiple barrier_wait cycles, so that both threads can actually end up in any epoch concurrently. Besides the data race, this can actually can lead to a deadlock. With the printf statements in the code, any pair of conflicting read/write accesses should be listed in the comment. |
I updated #151 to provide this description and added the missing data race pairs |
Hi, Sorry for the late reply. I was communicating with the original author for this code. We tried with CIVL and here is the output:
We also used inspector to test the code and inspector reported no data race. I think your comment matches the CIVL output. |
The lock-based barrier is effectively the same pattern as DRB186-barrier2-no.c. The commented lock is not necessary to provide the barrier semantics.
The text was updated successfully, but these errors were encountered: