From 735a88798d8e8c54a32ae6d273adc7fe205d7c6e Mon Sep 17 00:00:00 2001 From: d-netto Date: Sun, 21 Jan 2024 10:14:12 -0300 Subject: [PATCH] place work-stealing queue indices on different cache lines to avoid false-sharing --- src/work-stealing-queue.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/work-stealing-queue.h b/src/work-stealing-queue.h index 38429e02886e9..084e421fd58b3 100644 --- a/src/work-stealing-queue.h +++ b/src/work-stealing-queue.h @@ -36,7 +36,8 @@ static inline ws_array_t *create_ws_array(size_t capacity, int32_t eltsz) JL_NOT typedef struct { _Atomic(int64_t) top; - _Atomic(int64_t) bottom; + char _padding[128 - sizeof(int64_t)]; + _Atomic(int64_t) bottom; // put on a separate cache line. conservatively estimate cache line size as 128 bytes _Atomic(ws_array_t *) array; } ws_queue_t;