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

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Apr 13 22:10:59 PDT 2022


ye-luo requested changes to this revision.
ye-luo added inline comments.
This revision now requires changes to proceed.


================
Comment at: openmp/libomptarget/include/device.h:102
 
-    /// The id of the thread responsible for deleting this entry. This thread
-    /// set the reference count to zero *last*. Other threads might reuse the
-    /// entry while it is marked for deletion but not yet deleted (e.g., the
-    /// data is still being moved back). If another thread reuses the entry we
-    /// will have a non-zero reference count *or* the thread will have changed
-    /// this id, effectively taking over deletion responsibility.
-    std::thread::id DeleteThreadId;
+    /// Counter used to coordinate the deletion of an entry. Each thread that
+    /// decides the entry is to be deleted will increment the counter. As there
----------------
Each target task instead of thread.


================
Comment at: openmp/libomptarget/include/device.h:224
+  /// the entry.
+  void incDeleteCount() const { ++States->DeleteCount; }
+
----------------
Where does it get called?


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