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

Atomic operations on Pointers #37683

Closed
wants to merge 4 commits into from

Conversation

chethega
Copy link
Contributor

For some reason, Threads doesn't support atomic operations through general pointers. However, we need these operations in order to e.g. atomically operate on array entries.

While doing that, I noticed that llvm supports perfectly fine atomicrmw fadd and fsub intrinsics. These also boil down to a cas loop on x86_64, but the emitted assembly looks nicer for the llvm intrinsic than for the julia loop, so I took the liberty to change that as well (I don't expect significant performance changes for that).

Ref https://discourse.julialang.org/t/scattered-atomic-writes-into-array/46990/ and #32455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants