Skip to content

🍒[5.9][Concurrency] SerialExecutor.isSameExclusiveExecutionContext #64665

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

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Mar 28, 2023

Description: This adds the ability for different SerialExecutor instances opt into "complex equality" which they can implement themselfes. This logic is opted in by returning the executor as an UnownedSerialExecutor(complexEquality: self), and then the Swift runtime may choose to call the isSameExclusiveExecutionContext on the executor allowing it to implement "those two executors are using the same thread/queue and therefore should be considered the same exclusive context".
Risk: Low, the API is feature guarded and additive with a default implementation.
Review by: @jckarter @rokhinip @rjmccall
Testing: CI testing; tests were added for this specific pattern.
Original PR: #64604
Radar: rdar://107174704

@ktoso ktoso requested a review from a team as a code owner March 28, 2023 07:13
@ktoso
Copy link
Contributor Author

ktoso commented Mar 28, 2023

@swift-ci please test

In #64604 we also verified that this configuration works well in the "minimal" config

@ktoso ktoso added the concurrency Feature: umbrella label for concurrency language features label Mar 28, 2023
@ktoso ktoso changed the title [Concurrency] SerialExecutor.isSameExclusiveExecutionContext 🍒[5.9][Concurrency] SerialExecutor.isSameExclusiveExecutionContext Mar 28, 2023
@ktoso ktoso added the 🍒 release cherry pick Flag: Release branch cherry picks label Mar 28, 2023
@ktoso
Copy link
Contributor Author

ktoso commented Mar 28, 2023

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Mar 28, 2023

@swift-ci please test linux

@ktoso
Copy link
Contributor Author

ktoso commented Mar 28, 2023

@swift-ci please test macOS
@swift-ci please test Windows

@ktoso
Copy link
Contributor Author

ktoso commented Mar 28, 2023

@swift-ci please test macOS

@ktoso ktoso merged commit 2c3a9cc into swiftlang:release/5.9 Mar 29, 2023
@ktoso ktoso deleted the pick-isSameExclusiveExecutionContext branch March 29, 2023 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency Feature: umbrella label for concurrency language features 🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants