Skip to content

Commit

Permalink
place work-stealing queue indices on different cache lines to avoid f…
Browse files Browse the repository at this point in the history
…alse-sharing
  • Loading branch information
d-netto committed Jan 23, 2024
1 parent 5824c73 commit 735a887
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/work-stealing-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 735a887

Please sign in to comment.