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

Updated the documentation of spin_loop and spin_loop_hint #59664

Merged
merged 2 commits into from
Apr 4, 2019

Conversation

DevQps
Copy link
Contributor

@DevQps DevQps commented Apr 3, 2019

Description

  • Updated the description of core::hints::spin_loop
  • Updated the description of core::async::spin_loop_hint

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the spin_loop and spin_loop_hint functions) over yield_now. It also dives a little bit deeper on what the function actually does.

closes #55418

@rust-highfive
Copy link
Collaborator

r? @rkruppe

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 3, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:116f4e4f:start=1554282517681176085,finish=1554282628385919550,duration=110704743465
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:22:58] 
[01:22:58] running 9 tests
[01:22:58] iiiiiiiii
[01:22:58] 
[01:22:58]  finished in 0.156
[01:22:58] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:23:14] 
[01:23:14] running 121 tests
[01:23:40] .iiiii...i.....i..i...i..i.i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i. 100/121
[01:23:45] i.i......iii.i.....ii
[01:23:45] 
[01:23:45]  finished in 30.807
[01:23:45] travis_fold:end:test_debuginfo

---
[01:51:26] travis_fold:end:stage0-linkchecker

[01:51:26] travis_time:end:stage0-linkchecker:start=1554289321744213817,finish=1554289323800123346,duration=2055909529

[01:51:29] std/hint/fn.spin_loop.html:4: broken link - /checkout/obj/build/x86_64-unknown-linux-gnu/std/thread/fn.yield_now.html
[01:51:29] std/hint/fn.spin_loop.html:14: broken link - /checkout/obj/build/x86_64-unknown-linux-gnu/std/thread/fn.yield_now.html
[01:51:33] core/hint/fn.spin_loop.html:4: broken link - /checkout/obj/build/x86_64-unknown-linux-gnu/std/thread/fn.yield_now.html
[01:51:33] core/hint/fn.spin_loop.html:14: broken link - /checkout/obj/build/x86_64-unknown-linux-gnu/std/thread/fn.yield_now.html
[01:51:33] thread 'main' panicked at 'found some broken links', src/tools/linkchecker/main.rs:41:9
[01:51:33] 
[01:51:33] 
[01:51:33] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
[01:51:33] expected success, got: exit code: 101
[01:51:33] expected success, got: exit code: 101
[01:51:33] 
[01:51:33] 
[01:51:33] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:51:33] Build completed unsuccessfully in 0:40:41
[01:51:33] Makefile:48: recipe for target 'check' failed
[01:51:33] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:299bb582
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Apr  3 11:02:11 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

@bors: r+

Thanks @DevQps!

@bors
Copy link
Contributor

bors commented Apr 3, 2019

📌 Commit becee90 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 3, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 3, 2019
… r=alexcrichton

Updated the documentation of spin_loop and spin_loop_hint

# Description

- Updated the description of `core::hints::spin_loop`
- Updated the description of `core::async::spin_loop_hint`

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.

closes rust-lang#55418
@DevQps
Copy link
Contributor Author

DevQps commented Apr 3, 2019

@bors: r+

Thanks @DevQps!

No probs! Glad I could be of any assistance :)

@bors
Copy link
Contributor

bors commented Apr 3, 2019

@DevQps: 🔑 Insufficient privileges: Not in reviewers

bors added a commit that referenced this pull request Apr 3, 2019
Rollup of 5 pull requests

Successful merges:

 - #59076 (Include trailing comma in multiline Debug representation)
 - #59619 (wasi: Implement more of the standard library)
 - #59639 (Never return uninhabited values at all)
 - #59643 (std: Upgrade `compiler_builtins` to fix wasi linkage)
 - #59664 (Updated the documentation of spin_loop and spin_loop_hint)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Apr 3, 2019

@bors rollup

Centril added a commit to Centril/rust that referenced this pull request Apr 3, 2019
… r=alexcrichton

Updated the documentation of spin_loop and spin_loop_hint

# Description

- Updated the description of `core::hints::spin_loop`
- Updated the description of `core::async::spin_loop_hint`

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.

closes rust-lang#55418
Centril added a commit to Centril/rust that referenced this pull request Apr 3, 2019
… r=alexcrichton

Updated the documentation of spin_loop and spin_loop_hint

# Description

- Updated the description of `core::hints::spin_loop`
- Updated the description of `core::async::spin_loop_hint`

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.

closes rust-lang#55418
Centril added a commit to Centril/rust that referenced this pull request Apr 3, 2019
… r=alexcrichton

Updated the documentation of spin_loop and spin_loop_hint

# Description

- Updated the description of `core::hints::spin_loop`
- Updated the description of `core::async::spin_loop_hint`

Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.

closes rust-lang#55418
bors added a commit that referenced this pull request Apr 4, 2019
Rollup of 6 pull requests

Successful merges:

 - #59316 (Internal lints take 2)
 - #59663 (Be more direct about borrow contract)
 - #59664 (Updated the documentation of spin_loop and spin_loop_hint)
 - #59666 (Updated the environment description in rustc.)
 - #59669 (Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros)
 - #59677 (rustfix coverage: Skip UI tests with non-json error-format)

Failed merges:

r? @ghost
@bors bors merged commit becee90 into rust-lang:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document when to use std::thread::yield_now vs. std::sync::atomic::spin_loop_hint
6 participants