Skip to content

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