SE-0472: Starting tasks synchronously from caller context

Yes both those are examples of “staying in the same isolation (actor)” and therefore no suspensions take place in such calls.

By the “in general” I meant the very general case of two arbitrary contexts, I should have specified more concretely that there exist specific cases where we can know for sure.

Also depending on the default nonisolated async func isolation mode — accepted in [Accepted with modifications and focused re-review] SE-0461: Run nonisolated async functions on the caller's actor by default — calling a nonisolated async function under the caller isolation mode would also not cause suspensions but just keep running on the caller. But that’s dependent on which execution semantics a function has

2 Likes