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 modification operations for lifted arrays #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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