diff --git a/src/work-stealing-queue.h b/src/work-stealing-queue.h index 38429e02886e9..070a42b98ef85 100644 --- a/src/work-stealing-queue.h +++ b/src/work-stealing-queue.h @@ -36,6 +36,13 @@ static inline ws_array_t *create_ws_array(size_t capacity, int32_t eltsz) JL_NOT typedef struct { _Atomic(int64_t) top; + // put `top` and `bottom` on different cache lines + // to avoid false sharing +#ifdef _P64 + void *_ignore[7]; +#else + void *_ignore[15]; +#endif _Atomic(int64_t) bottom; _Atomic(ws_array_t *) array; } ws_queue_t;