Skip to content

Commit 735a887

Browse files
committed
place work-stealing queue indices on different cache lines to avoid false-sharing
1 parent 5824c73 commit 735a887

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+
char _padding[128 - sizeof(int64_t)];
40+
_Atomic(int64_t) bottom; // put on a separate cache line. conservatively estimate cache line size as 128 bytes
4041
_Atomic(ws_array_t *) array;
4142
} ws_queue_t;
4243

0 commit comments

Comments
 (0)