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_min doesn't return old value for floats #35499

Closed
eaubanel opened this issue Apr 16, 2020 · 0 comments · Fixed by #35509
Closed

atomic_min doesn't return old value for floats #35499

eaubanel opened this issue Apr 16, 2020 · 0 comments · Fixed by #35509
Assignees
Labels
domain:multithreading Base.Threads and related functionality

Comments

@eaubanel
Copy link

I originally posted this on Discourse: https://discourse.julialang.org/t/atomic-min-for-floats/35880

Here is the MWM, copied from that post:

julia> E = Atomic{Float64}(10)
Atomic{Float64}(10.0)

julia> atomic_min!(E, 3.0)
3.0

julia> E
Atomic{Float64}(3.0)

atomic_min!(E, 3.0) should return 10.0 (i.e., the old value), not 3.0, as per the documentation. If I change the code to use Int64 then atomic_min() returns the old value (10).

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

Successfully merging a pull request may close this issue.

3 participants