Skip to content

🍒 5.5+ [Concurrency] set queue width on non apple platforms #39766

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

Merged

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Oct 15, 2021

Description: To avoid thread explosions, i.e. thread growth to the hardcoded number of 255 when tasks are blocked on Linux (and other non apple platforms), and in order to get the same behavior as Swift Concurrency has on Darwin (and back deployment), we must set the global queue width as we set it up for swift concurrency. Without this, when tasks block for even short bursts, we end up with many many threads on Linux systems. The fix sets the width, same as we do on back deployment and gets us consistent behavior across platforms, and no thread explosions.
Risk: Low, affects only non-apple platforms
Review by: @DougGregor @rjmccall @tomerd
Testing: verified manually using example applications;
Original PR: #39764 and the previous one #39742
Radar: rdar://79907041

@ktoso ktoso requested a review from a team as a code owner October 15, 2021 03:40
@ktoso
Copy link
Contributor Author

ktoso commented Oct 15, 2021

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Oct 15, 2021

@swift-ci please test Windows

@tomerd
Copy link
Contributor

tomerd commented Oct 15, 2021

👍

@ktoso
Copy link
Contributor Author

ktoso commented Oct 15, 2021

Windows having weird issues: Syntax error in cmake code at ...

@ktoso
Copy link
Contributor Author

ktoso commented Oct 15, 2021

@swift-ci please test Windows

@ktoso ktoso changed the title [Concurrency] set queue width on non apple platforms 🍒 5.5+ [Concurrency] set queue width on non apple platforms Oct 15, 2021
@ktoso ktoso merged commit 63fc969 into swiftlang:release/5.5-08092021 Oct 15, 2021
@ktoso ktoso deleted the wip-pick-linux-thread-width branch October 15, 2021 23:31
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.

3 participants