Skip to content

Commit fd2c1b8

Browse files
committed
place work-stealing queue indices on different cache lines to avoid false-sharing
1 parent 4d26be0 commit fd2c1b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/work-stealing-queue.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ static inline ws_array_t *create_ws_array(size_t capacity, int32_t eltsz) JL_NOT
3636

3737
typedef struct {
3838
_Atomic(int64_t) top;
39-
_Atomic(int64_t) bottom;
39+
_Alignas(128) _Atomic(int64_t) bottom; // put on a separate cache line
40+
// conservatively estimate cache line size as 128 bytes
4041
_Atomic(ws_array_t *) array;
4142
} ws_queue_t;
4243

0 commit comments

Comments
 (0)