Hello, Swift community.
The review of SE-0424: Custom isolation checking for SerialExecutor
ran from February 22nd through March 4th, 2024. Feedback was light but positive on the general idea.
A question was raised during the review about the design of the new checkIsolation
requirement. Specifically, this requirement is specified to trap when the current context does not have the right isolation; there's no way to simply test the current isolation. This matches the current isolation-testing features in the concurrency runtime, such as assumeIsolated
, but it wouldn't work for potential future features such as actor.whenIsolated { ... }
. The Language Steering Group considered this issue and decided that we're comfortable with leaving that as a feature direction — if we add an API like whenIsolated
in the future (which is far from certain), we can add a new requirement then. But it's noteworthy that Dispatch
(the most prominent custom executor implementation in the Swift ecosystem) would not be able to implement that requirement with its current public API, making that a pretty unreliable feature to use with an unknown executor. If an actor knows that it uses an executor that supports a boolean-testing API, it can provide its own, concrete whenIsolated
API without relying on the standard library.
Accordingly, SE-0424 is accepted.
I'd like to thank the reviewers for their contributions to Swift. As always, open evolution review is an instrumental part of making Swift a better language.
John McCall
Review Manager