[Openmp-commits] [PATCH] D123444: [OpenMP][FIX] Simplify the entry deletion scheme

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Apr 17 13:03:44 PDT 2022


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:866
       if (LR.Entry->getTotalRefCount() != 0 ||
-          LR.Entry->getDeleteThreadId() != std::this_thread::get_id()) {
+          LR.Entry->decDeleteCount() != 0) {
         // The thread is not in charge of deletion anymore. Give up access to
----------------
ye-luo wrote:
> In another thread which is working on increase the refcount may have a race with the current thread deleting the entry because the other thread released HDTTMapAccessorTy and only have the entry locked.
No. HDTTMap is still locked here. In the next patch we introduce the consistent locking for entries. So HDTTMap is locked, and  then we lock entry, and then we do the lookup. No other thread can modify the entry at that point and the ref count and delete count will be valid.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123444



More information about the Openmp-commits mailing list