Skip to content

Conversation

ianks
Copy link
Contributor

@ianks ianks commented May 3, 2018

After reviewing the atomic boolean code a bit, I noticed the atomic boolean was not using memory barriers when getting and setting values. This PR ensures that those memory barriers are used in all places.

@ghost ghost assigned pitr-ch May 7, 2018
@ghost ghost added the in progress label May 7, 2018
Copy link
Member

@pitr-ch pitr-ch left a comment

Choose a reason for hiding this comment

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

Thanks!

@pitr-ch
Copy link
Member

pitr-ch commented May 7, 2018

I've fixed the .gitignore change.

Regarding C atomic code: it could actually have no memory barriers assuming it does not call other Ruby methods. Since when it is in a C Ruby code, it cannot be switched to other Thread and GVL takes care of visibility on the later Thread switch. However nobody ever redid it in this way depending on these assumptions (facts).

@pitr-ch pitr-ch merged commit b461ffc into ruby-concurrency:master May 7, 2018
@ghost ghost removed the in progress label May 7, 2018
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