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

Task Priority Escalation APIs #2685

Merged
merged 8 commits into from
Feb 20, 2025
Merged

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Feb 6, 2025

Proposal for impl over at: swiftlang/swift#78625

@ktoso ktoso force-pushed the wip-task-prio-escalation branch from cea9422 to 9b37040 Compare February 10, 2025 06:55
@ktoso ktoso force-pushed the wip-task-prio-escalation branch from 9b37040 to f0f83ec Compare February 10, 2025 06:56
@ktoso ktoso marked this pull request as ready for review February 11, 2025 00:08
}
```

The above example showcases a common pattern: often an unchecked continuation is paired with a Task used to complete it. Around the suspension on the continuation, waiting for it to be resumed, developers often install a task cancellation handler in order to potentially break out of potentially unbounded waiting for a continuation to be resumed. Around the same suspension (marked with `HERE` in the snippet above), we might want to insert a task priority escalation handler in order to priority boost the task that is used to resume the continuation. This can be important for correctness and performance of such operations, so we should find a way to offer these libraries to participate in task priority handling.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

often an unchecked continuation

there's a mix of checked & unchecked continuations in the above example. maybe drop the additional descriptor and just go with 'continuation'.

so we should find a way to offer these libraries [a mechanism] to participate in task priority handling.

@ktoso
Copy link
Contributor Author

ktoso commented Feb 19, 2025

This should be ready to go 👍

@Jumhyn Jumhyn merged commit 991e4c8 into swiftlang:main Feb 20, 2025
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.

5 participants