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

NIOPosix on Darwin: inherit main thread QoS #2944

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

weissi
Copy link
Member

@weissi weissi commented Oct 23, 2024

Motivation:

On Darwin, QoS (quality of service) of threads plays an important role, especially on Apple Silicon machines with P-cores and E-cores. If you spawn raw threads (like NIOPosix) and use a mechanism that doesn't support QoS propagation (like reading/writing to networks -- like NIOPosix does), it's recommended to default to the main thread's QoS.

Otherwise you'll always be at the default QoS for "legacy" threads which means bad latencies, especially on Apple Silicon machines.

In a follow-up PR #2943 we're adding better configurability for thread configuration.

Modifications:

Default to main thread QoS on Darwin.

Result:

Better latencies for applications with higher QoS classes.

@weissi weissi requested a review from Lukasa October 23, 2024 14:25
@weissi weissi added the 🔨 semver/patch No public API change. label Oct 23, 2024
@weissi weissi force-pushed the jw-inherit-main-qos branch from d55f1ab to 85c2e08 Compare October 23, 2024 14:27
@Lukasa Lukasa merged commit f6230d3 into apple:main Oct 23, 2024
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants