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

Fix race condition in test introduced in #33119 (oops). #34142

Closed
wants to merge 2 commits into from

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Dec 19, 2019

Introduce synchronization (via a Channel()) to force spawned tasks to
run after the local variables are updated, showcasing the problem and
the solution with $-interpolation.

Fixes race condition in test introduced in #33119.

Fixes #34141.

Introduce synchronization (via a `Channel()`) to force spawned tasks to
run after the local variables are updated, showcasing the problem and
the solution with `$`-interpolation.
@JeffBezanson JeffBezanson added this to the 1.4 milestone Dec 19, 2019
# Without interpolation, each spawned task sees the last value of `i` (6);
# with interpolation, each spawned task has the value of `i` at time of `@spawn`.
let
oneinterp = Vector{Any}(undef, 5)
Copy link
Member

Choose a reason for hiding this comment

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

Should be 4 spaces instead of 3 for this block

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Looks right. Was there a merge conflict at the bottom though? Deleting that other test doesn't seem related.

@NHDaly
Copy link
Member Author

NHDaly commented Dec 20, 2019 via email

@vchuravy
Copy link
Member

Merged locally as 608567f to fixup the indent and squash the PR.

@vchuravy vchuravy closed this Dec 20, 2019
@KristofferC
Copy link
Member

Did that fix the wrongly deleted test?

@NHDaly
Copy link
Member Author

NHDaly commented Dec 20, 2019

Thanks a bunch, @vchuravy! <3

@KristofferC, no, sorry, it wasn't wrongly deleted. It was correctly deleted, because #33119 wrongly duplicated it due to a bad merge. Added here:
https://github.com/JuliaLang/julia/pull/33119/files#diff-d94a81ec91d1b6e2ba2cdb900b30cb3dR774
Duplicated from here:
https://github.com/JuliaLang/julia/pull/33119/files#diff-d94a81ec91d1b6e2ba2cdb900b30cb3dR684

@vtjnash
Copy link
Member

vtjnash commented Dec 20, 2019

I appreciate the parallelism of how this was fixing two race conditions.

@NHDaly
Copy link
Member Author

NHDaly commented Dec 21, 2019

😂

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.

Race condition in new threading test
6 participants