Skip to content

Conversation

@jamieQ
Copy link
Contributor

@jamieQ jamieQ commented Dec 15, 2025

This change adopts caller isolation inheritance via parameter isolation in Async{Throwing}Channel and corresponding AsyncIterator types.

Resolves: #356

This change adopts caller isolation inheritance via parameter isolation
in Async{Throwing}Channel and corresponding AsyncIterator types.

Resolves: apple#356
@jamieQ
Copy link
Contributor Author

jamieQ commented Dec 15, 2025

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:

  1. are there concerns with adding defaulted isolated parameters into existing API?
  2. is tackling this sort of thing in a piecemeal fashion palatable, or have you considered a wholesale audit of the repo to address the class of issue?
    • relatedly, do you have thoughts regarding opting into NonisolatedNonsendingByDefault at some point (though i'm personally not sure it's totally ready for all use cases yet)?

@FranzBusch
Copy link
Member

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 NonisolatedNonsendingByDefault. We have it enabled in a few repos already and it seems to work well. It also makes it easier to adopt since it will just flip the default for 6.2+ and stay the same on older compiler versions. Did you give it a try to compile this repo with that default enabled and see if we run into any issues?

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.

FIFO not respected in AsyncChannel

2 participants