From b7559a18a698b7723b0bfaf34d1813be92b14705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Wed, 7 Feb 2024 05:30:32 +0100 Subject: [PATCH] remove cerr warning --- offloading-cacher/cache.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/offloading-cacher/cache.hpp b/offloading-cacher/cache.hpp index a60fd2e..ec11d3d 100644 --- a/offloading-cacher/cache.hpp +++ b/offloading-cacher/cache.hpp @@ -392,7 +392,6 @@ inline std::unique_ptr dsacache::Cache::Access(uint8_t* dat // data source location if (CheckFlag(flags, FLAG_ACCESS_WEAK)) { - std::cerr << "[!] CacheAccess with WEAK set encountered miss!" << std::endl; task->SetCacheToSource(); return std::move(task); } @@ -740,8 +739,12 @@ inline void dsacache::CacheData::WaitOnCompletion() { // exchange the global handlers pointer with nullptr to have a local // copy - this signals that this thread is the sole owner and therefore // responsible for waiting for them. we can not set to nullptr here but - // set to maximum of 64-bit in order to prevent deadlocks from the above - // waiting construct + // set to secondary invalid value in order to prevent deadlocks from + // the above waiting construct, where threads may miss the short period + // in which the handlers are not nullptr. we could use double width cas + // which however is more expensive and therefore introduce the second + // invalid state to solve the aba occurring here + // see https://en.wikipedia.org/wiki/ABA_problem for more info std::vector* local_handlers = handlers_->exchange(invalid_handlers_);