-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Update example in "Rust Inside Other Languages" #26311
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
Conversation
@@ -66,10 +66,15 @@ threads = [] | |||
5_000_000.times do | |||
count += 1 | |||
end | |||
|
|||
Thread.current[:output] = count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, this changes it from the rust significantly, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, my ruby is not very up to par. Would it be better to just return count
from the threads and then collect the values using t.value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that seems better 👍
Use result of the computation to prevent the compiler from optimising too much. Change `_x` to `x` and therefore remove the paragraph about the underscore. Fixes rust-lang#25855.
Updated. |
@bors: r+ |
📌 Commit 3e7ab1b has been approved by |
Thanks! :) |
⌛ Testing commit 3e7ab1b with merge 8b31bd3... |
⛄ The build was interrupted to prioritize another pull request. |
Use result of the computation to prevent the compiler from optimising too much. Change `_x` to `x` and therefore remove the paragraph about the underscore. Fixes #25855. r? @steveklabnik
Use result of the computation to prevent the compiler from optimising
too much. Change
_x
tox
and therefore remove the paragraph aboutthe underscore.
Fixes #25855.
r? @steveklabnik