Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why shall we need blocks? #6

Open
TheodoreG opened this issue Aug 29, 2024 · 0 comments
Open

Why shall we need blocks? #6

TheodoreG opened this issue Aug 29, 2024 · 0 comments

Comments

@TheodoreG
Copy link

TheodoreG commented Aug 29, 2024

Hey, I am reading the implementation of SPSC Var queue, I found that the minimum unit to store data is called block, each block is 64Bytes, which is consistent to the size of cacheline.
But for https://github.com/rigtorp/SPSCQueue, he did not use this design, he just make the data buffer region aligned with cacheline both in start and the end. But inside the buffer, data is next to each other.
This design may bring the problem of wasting space when data pushed has little size, like 4B or 8B, cause each of them would take the whole block.
Could you help to explain it? Thanks!

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

No branches or pull requests

1 participant