Skip to content

NIOPosix on Darwin: inherit main thread QoS#2944

Merged
Lukasa merged 1 commit into
apple:mainfrom
weissi:jw-inherit-main-qos
Oct 23, 2024
Merged

NIOPosix on Darwin: inherit main thread QoS#2944
Lukasa merged 1 commit into
apple:mainfrom
weissi:jw-inherit-main-qos

Conversation

@weissi
Copy link
Copy Markdown
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
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