From 1b1bf1f43c2b5d30e23968595888af40b22b2dfb Mon Sep 17 00:00:00 2001 From: starry <1359755959@qq.com> Date: Mon, 4 May 2026 22:28:01 +0800 Subject: [PATCH] Use compare_exchange_weak in steal loop for potential performance improvement --- src/bthread/work_stealing_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bthread/work_stealing_queue.h b/src/bthread/work_stealing_queue.h index 06e9ed074c..138aaa6ba8 100644 --- a/src/bthread/work_stealing_queue.h +++ b/src/bthread/work_stealing_queue.h @@ -128,7 +128,7 @@ class WorkStealingQueue { return false; } *val = _buffer[t & (_capacity - 1)]; - } while (!_top.compare_exchange_strong(t, t + 1, + } while (!_top.compare_exchange_weak(t, t + 1, butil::memory_order_seq_cst, butil::memory_order_relaxed)); return true;