Skip to content

Match SPSCQueue false-sharing ranges - #62

Merged
rigtorp merged 1 commit into
masterfrom
v2/02c-false-sharing
Nov 18, 2026
Merged

rigtorp merged 1 commit into
masterfrom
v2/02c-false-sharing

Conversation

@rigtorp

@rigtorp rigtorp commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

Match SPSCQueue's false-sharing ranges for queue counters and slots.

Architecture Before After
x86-64, non-Apple AArch64, PowerPC64 64 B 128 B
Apple AArch64 128 B 128 B
s390x 256 B 256 B
Other 64 B 64 B

The 128-byte spacing puts neighboring hot locations in separate aligned
pairs for CPUs with adjacent-cache-line prefetching.

Evidence

  • Before On x86-64, an int slot occupied 64 bytes and had 64-byte alignment.
  • After The same probe reported 128 bytes and 128-byte alignment.
    Clang Release passed MPMCQueueTest. The rebased release stack also passed
    ASan/UBSan, GCC 14 MC/DC, and GenMC. Throughput is still unmeasured.

Merge Danger

Door Two-way. Reverting restores the previous spacing.

Blast radius Consumers on the affected architectures must rebuild
together because the queue layout changes. Small-element queues use more
memory per slot.

@rigtorp
rigtorp merged commit 3fd3443 into master Nov 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant