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

Docs for atomic orderings: link to the 'nomicon article for further reading #39200

Merged
merged 5 commits into from Jan 24, 2017

Conversation

DirkyJerky
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@DirkyJerky
Copy link
Contributor Author

DirkyJerky commented Jan 20, 2017

Tidy (in the travis build) failed because:

Rustfmt failed at iter/mod.rs:1231: line exceeded maximum length (maximum: 100, found: 102) (sorry)
Rustfmt failed at str/mod.rs:1643: line exceeded maximum length (maximum: 100, found: 145) (sorry)
Rustfmt failed at str/mod.rs:1668: line exceeded maximum length (maximum: 100, found: 143) (sorry)
Rustfmt failed at fmt/mod.rs:1103: line exceeded maximum length (maximum: 100, found: 116) (sorry)

/// If you are confused or don't have enough time to research which ordering to use, use `SeqCst`.
/// Of all the options it has the most unsurpising effect (see the nomicon for details. [1])
/// The downside is you miss out on several optimizations the other orderings offer.
///
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just something completely optional I feel would help people (beginners) who have no clue how orderings work and just want to get sample code working.

Copy link
Member

Choose a reason for hiding this comment

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

I’d argue that if one is confused/doesn’t have time to research, they should not be writing code involving atomics at all and just use a Mutex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point

@DirkyJerky
Copy link
Contributor Author

Also apoligies if this has been discussed before, but would a Default implementation (of SeqCst) be appropriate for Ordering? (as how cpp does it)

@BurntSushi
Copy link
Member

@steveklabnik I assigned this over to you because you might have opinions on the wording here.

@BurntSushi
Copy link
Member

@DirkyJerky A Default impl doesn't feel completely right or completely wrong to me. I expect that should be submitted as a separate PR, and that would need to go through the libs team approval.

@steveklabnik
Copy link
Member

looks good to me, thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 23, 2017

📌 Commit c0a5b99 has been approved by steveklabnik

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 23, 2017
Docs for atomic orderings: link to the 'nomicon article for further reading
bors added a commit that referenced this pull request Jan 23, 2017
Rollup of 7 pull requests

- Successful merges: #38794, #38956, #38993, #39191, #39200, #39233, #39258
- Failed merges:
@bors bors merged commit c0a5b99 into rust-lang:master Jan 24, 2017
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.

None yet

6 participants