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

False sharing? #3

Open
fzyzcjy opened this issue Nov 14, 2022 · 2 comments
Open

False sharing? #3

fzyzcjy opened this issue Nov 14, 2022 · 2 comments

Comments

@fzyzcjy
Copy link

fzyzcjy commented Nov 14, 2022

Hi, I am not an expert in concurrent programming, but I have learnt "false sharing", which means that, when multi cpu cores write to data in the same cache line, it may be quite slow because they can invalidate caches in other cpu cores. Thus, it seems reasonable to ensure those AtomicUsizes are not in the same cache line, such as by inserting dummy paddings.

@JackThomson2
Copy link
Owner

Hey this, was definitely happening. I've addressed this in this PR: #1 the performance has been dramatically improved!

Thanks

@fzyzcjy
Copy link
Author

fzyzcjy commented Nov 15, 2022

Happy to see that!

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

2 participants