# Determining whether an async function will run on the main actor

**URL:** <https://forums.swift.org/t/determining-whether-an-async-function-will-run-on-the-main-actor/60749>\
**Category:** Using Swift\
**Tags:** concurrency\
**Created:** [October 10, 2022, 11:29am UTC](https://forums.swift.org/t/determining-whether-an-async-function-will-run-on-the-main-actor/60749 "2022-10-10T11:29:10Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![TheDeanosaurus](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/thedeanosaurus/32/9098_2.png) [@TheDeanosaurus](https://forums.swift.org/u/TheDeanosaurus)\
**Post date:** [March 19, 2025, 2:26pm UTC](https://forums.swift.org/t/determining-whether-an-async-function-will-run-on-the-main-actor/60749/17 "2025-03-19T14:26:46Z")

</div>

> ...the declaration decides where it wants to run...

That is until [this proposal](https://forums.swift.org/t/se-0461-run-nonisolated-async-functions-on-the-callers-actor-by-default/77987) gets through correct? Then it's only if the declaration explicitly declares it should run concurrently or with a different specific isolation (i.e. is an actor or part of a global actor different from the current isolation).

I wanted to ask **you** specifically because you're involved in that thread but it didn't seem like a place to interject, but if that proposal goes through and the caller then specifies the isolation by default, does that mean that **any** async function that doesn't specify a different isolation will effectively run like a synchronous function (without suspending?).

```swift
struct SomeWork {

    func execute() async throws {
        print(1+1)
        // If this awaited execution on the main actor this would be the *first*
        // and only suspension point other than the initial call into the actor.
    }
}

struct SomeOtherWork {
    func execute() async throws -> Foo {
        // Would this then forward the same isolation?
        try await SomeWork().execute()
        return Foo()
    }
}

actor IAmTheIsolation {

    func doTheThing() async throws -> Foo {
        // Since this now inherits the same isolation does it even suspend?
        try await SomeOtherWork().execute()
}

```

Is my assumption correct there? Does that technically make everything more performant as well since there's less suspending?

---

_[View the full topic](https://forums.swift.org/t/determining-whether-an-async-function-will-run-on-the-main-actor/60749)._
