-
Notifications
You must be signed in to change notification settings - Fork 189
[WIP]: inherit caller isolation in some AsyncChannel methods #388
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
Conversation
This change adopts caller isolation inheritance via parameter isolation
in Async{Throwing}Channel and corresponding AsyncIterator types.
Resolves: apple#356
|
cc @FranzBusch @phausler – this is largely a PoC of how we might address some executor hops that could lead to unexpected event orderings. i'd like to hear your thoughts on the approach. in particular:
|
|
Thanks for opening this. I think this is a good effort and we should inherit isolation in all async methods possible both for correctness and performance. I do think we should try to do this by enabling |
@FranzBusch i did a very brief test, and there were many errors involving non-sendability that immediately surfaced for isolation boundary closures (i believe possibly fixed in swiftlang/swift#85603 and friends). also, basically every async iterator IIUC just enabling that feature now also would not resolve the issues with hops when calling the concurrency runtime functions ( |
|
Thanks for the investigation. I expected that we will need a multi-step effort to get this repo to compile cleanly with the feature enabled. We should do it nevertheless.
My recent testing showed that in 5.10 and below the Concurrency runtime |
|
@FranzBusch thanks, that makes sense. i'll close this then if the piecemeal strategy isn't appropriate.
just to clarify – i also don't expect this, but my thinking is just that today there is a way to address certain classes of unexpected executor hops with the existing runtime functions that take isolated parameters: ensure the caller has an isolated parameter too, and that it is captured by the closures passed to the runtime functions. but that technique appears to not work if an explicit isolated parameter function is converted to |
|
closing in favor of some more holistic approach |
This change adopts caller isolation inheritance via parameter isolation in Async{Throwing}Channel and corresponding AsyncIterator types.
Resolves: #356