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

为什么只有Tail、Cursor指针、Flag-RingBuffer中采用了CacheLine 补齐方式? #50

Closed
csonezp opened this issue Apr 20, 2020 · 1 comment

Comments

@csonezp
Copy link

csonezp commented Apr 20, 2020

UID-RingBuffer不需要吗?

@yuzhaopeng
Copy link

yuzhaopeng commented Dec 31, 2021

我理解是因为在并发获取uid的情况下,uid-RingBuffer 只读不写,但是 Flag-RingBuffer 是读写一起的,读完立马就写,如果不做CacheLine填充,就会出现相邻的两个flag 加载到同一个CacheLine中,两个线程同时写flag 出现竞争,然后影响并发性能

@baozhi baozhi closed this as completed Mar 27, 2024
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

3 participants