[Openmp-commits] [PATCH] D76780: [OpenMP] Added memory barrier to solve data race
Bryan Chan via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Mar 25 14:06:01 PDT 2020
bryanpkc added a comment.
In D76780#1941764 <https://reviews.llvm.org/D76780#1941764>, @Hahnfeld wrote:
> Yes, this looks related to memory consistency. As far as I understand the threads synchronize on `th_spin_here`, so this is guaranteed to be updated. Any other write before this in `__kmp_release_queuing_lock` is not guaranteed to be synchronized by a weak memory model. This includes `th_next_waiting` (which triggers the assertion), but also writes by the user application. That's particularly bad because this should be taken care of by the runtime!
Why doesn't the `KMP_MB` after the store to `th_next_waiting` guarantee that the unblocked thread sees that store?
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the Openmp-commits