This is an automated email from the ASF dual-hosted git repository.
chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 2a02d9e3 Use compare_exchange_weak in steal loop for potential
performance improvement (#3285)
2a02d9e3 is described below
commit 2a02d9e3fb4e03df1da1ff4eb7665e4773188930
Author: xin_github <[email protected]>
AuthorDate: Wed May 6 15:16:06 2026 +0800
Use compare_exchange_weak in steal loop for potential performance
improvement (#3285)
---
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 06e9ed07..138aaa6b 100644
--- a/src/bthread/work_stealing_queue.h
+++ b/src/bthread/work_stealing_queue.h
@@ -128,7 +128,7 @@ public:
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;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]