[Openmp-commits] [PATCH] D136952: [libomptarget] Fix a race condition in checkDeviceAndCtors

Lechen Yu via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 28 18:35:53 PDT 2022


lechenyu added a comment.

In D136952#3893183 <https://reviews.llvm.org/D136952#3893183>, @tianshilei1992 wrote:

> In D136952#3893157 <https://reviews.llvm.org/D136952#3893157>, @jhuber6 wrote:
>
>> In D136952#3893155 <https://reviews.llvm.org/D136952#3893155>, @tianshilei1992 wrote:
>>
>>> Once per device?
>>
>> It just means that we'd need an array of `std::once_flags` for each device. It's not a huge barrier but not sure if it's that much more convenient.
>
> Yeah, that's what I mean. I generally think `std::once_flags` is cleaner than this method. I'm fine using `PendingGlobalsMtx` here as we can't get rid of it anyway.

Hi, Shilei,

Should I land this patch or replace the lock with `std::once_flags`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136952/new/

https://reviews.llvm.org/D136952



More information about the Openmp-commits mailing list