Skip to content

🍒 5.5 [Concurrency] Limit queue width with set_width SPI call on linux #39742

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
merged 1 commit into from
Oct 14, 2021

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Oct 14, 2021

Description: To avoid thread explosions, i.e. thread growth to the hardcoded number of 255 when tasks are blocked on Linux, 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 burtsts, 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, this is how it was supposed to work to begin with.
Review by: @DougGregor
Testing: Verified the fix works manually on Ubuntu boxes, with sample applications. A bit hard to test this automatically, as we'd need to check for thread counts in the system.
Original PR: #39732
Radar: rdar://79907041

@ktoso ktoso requested a review from a team as a code owner October 14, 2021 12:09
@ktoso
Copy link
Contributor Author

ktoso commented Oct 14, 2021

@swift-ci please test

@DougGregor
Copy link
Member

@swift-ci please nominate

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.

2 participants