Skip to content

Conversation

@treeowl
Copy link

@treeowl treeowl commented Jun 21, 2018

Addresses #64

@treeowl
Copy link
Author

treeowl commented Jun 21, 2018

I'm not sure this is entirely safe. Could another thread see the successful swap before it sees the "preceding" oldref update?

@treeowl
Copy link
Author

treeowl commented Jun 21, 2018

I suspect that the CAS gives an ordering guarantee, but I'm not entirely sure.

@treeowl treeowl force-pushed the ama branch 5 times, most recently from f62f567 to bdb1e3e Compare June 21, 2018 19:45
@treeowl
Copy link
Author

treeowl commented Jun 21, 2018

@winterland1989, what do you think of these?

@winterland1989
Copy link

The code seems OK, may need some tests and benchs, but i'm agree with you that we really should implement this in cmm.

-> IO b
atomicModifyArrayElem' mary i fn = do
(new, res) <- atomicModifyArrayElem_ mary i fn
evaluate new
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should actually just seq here.

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

Successfully merging this pull request may close these issues.

2 participants