From 01c7548e4c915d55c5426a6477d399ba16a3e62c Mon Sep 17 00:00:00 2001 From: Bruno Date: Thu, 7 Nov 2024 06:59:48 +0100 Subject: [PATCH] Hanging problem with 144 threads on grosminet: testing strict memory ordering and atomicity for mark_cell_as_conflict() (normally should not be the problem since cell is already acquired by thread when calling this function, but this is the only thing I see for now...) --- src/lib/geogram/delaunay/delaunay_sync.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/geogram/delaunay/delaunay_sync.h b/src/lib/geogram/delaunay/delaunay_sync.h index bb47e870afa9..d3c88c168b62 100644 --- a/src/lib/geogram/delaunay/delaunay_sync.h +++ b/src/lib/geogram/delaunay/delaunay_sync.h @@ -194,11 +194,20 @@ namespace GEO { // do not need since this function is always used by // a thread that previously acquired the cell (well in // practice it gives approximately the same performance). + + /* cell_status_[cell].store( cell_status_[cell].load( std::memory_order_relaxed ) | CONFLICT_MASK, std::memory_order_relaxed ); + */ + + // Testing with fetch_or (on grosminet we get stuck with + // 144 threads and I do not know why...) + cell_status_[cell].fetch_or( + CONFLICT_MASK // , std::memory_order_relaxed + ); } /**