# Question About Actor Isolation in WWDC Video

**URL:** <https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325>\
**Category:** Using Swift\
**Tags:** actors\
**Created:** [November 20, 2025, 12:11pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325 "2025-11-20T12:11:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![asaadjaber](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@asaadjaber](https://forums.swift.org/u/asaadjaber)\
**Post date:** [November 20, 2025, 12:11pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/1 "2025-11-20T12:11:51Z")

</div>

I was watching the WWDC Video, “[Protect Mutable State with Swift Actors](https://developer.apple.com/videos/play/wwdc2021/10133)”, in which the second speaker discusses actors and protocol conformances.

The speaker presents the [following](https://developer.apple.com/videos/play/wwdc2021/10133/?time=816) code example:

```swift
actor LibraryAccount {
    let idNumber: Int
    var booksOnLoan: [Book] = []
}

extension LibraryAccount: Equatable {
    static func == (lhs: LibraryAccount, rhs: LibraryAccount) -> Bool {
        lhs.idNumber == rhs.idNumber
    }
}

```

The speaker then states that `==` is not isolated to the actor. What does “not isolated to the actor” mean? The speaker goes on to say, “we have two parameters of actor type, and this static method is outside of both of them.“ I know there’s answer to this [here](https://forums.swift.org/t/what-does-non-isolated-mean-in-se-0306/83191/4), but I still don’t understand what it means to be “not isolated to the actor”.

The speaker contrasts this with another example,

```swift
extension LibraryAccount: Hashable {
    func hash(into hasher: inout Hasher) {
        hasher.combine(idNumber)
    }
}

```

The speaker states that this conformance isn’t allowed and that conforming to `Hashable` this way means this function could be called from outside the actor. I basically feel like I don’t understand what actor isolation means, even though I’ve read the proposal a number of times.

---

<div class="post-metadata">

**Author:** ![ibex](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ibex/32/30439_2.png) [@ibex](https://forums.swift.org/u/ibex)\
**Post date:** [November 20, 2025, 12:47pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/2 "2025-11-20T12:47:46Z")

</div>

> [@asaadjaber](#):
>
> The speaker then states that `==` is not isolated to the actor. What does “not isolated to the actor” mean? The speaker goes on to say, “we have two parameters of actor type, and this static method is outside of both of them.“ I know there’s answer to this [here](https://forums.swift.org/t/what-does-non-isolated-mean-in-se-0306/83191/4), but I still don’t understand what it means to be “not isolated to the actor”.

I am no expert, but it most likely means this. Because the function is static, and it is not attached to an isolation domain, it will always run in the caller’s execution context.

> [@asaadjaber](#):
>
> I basically feel like I don’t understand what actor isolation means,

It means when you invoke a function isolated to an actor, the function will run in that actor’s execution context. As you most likely already know, an actor has a message queue (or mailbox) that receives the execution requests which the actor handles one at a time in its execution context.

---

<div class="post-metadata">

**Author:** ![asaadjaber](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@asaadjaber](https://forums.swift.org/u/asaadjaber)\
**Post date:** [November 20, 2025, 12:57pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/3 "2025-11-20T12:57:06Z")

</div>

Okay, and what is an execution context? (please explain in layman’s terms if possible)

---

<div class="post-metadata">

**Author:** ![asaadjaber](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@asaadjaber](https://forums.swift.org/u/asaadjaber)\
**Post date:** [November 20, 2025, 1:09pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/4 "2025-11-20T13:09:36Z")

</div>

> [@ibex](#):
>
> As you most likely already know, an actor has a message queue (or mailbox) that receives the execution requests which the actor handles one at a time in its execution context.

Okay, so this implies that non-actor types also have their own execution contexts, since they also need to process their own requests.

---

<div class="post-metadata">

**Author:** ![ibex](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ibex/32/30439_2.png) [@ibex](https://forums.swift.org/u/ibex)\
**Post date:** [November 20, 2025, 1:11pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/5 "2025-11-20T13:11:30Z")

</div>

> [@asaadjaber](#):
>
> and what is an execution context?

An environment consisting of some state plus a thread.

@jamieQ , @John_McCall : please help us here. 😕

---

<div class="post-metadata">

**Author:** ![John\_McCall](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/john_mccall/32/1351_2.png) [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Post date:** [November 20, 2025, 5:36pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/6 "2025-11-20T17:36:48Z")

</div>

I think it might be a little misleading to talk about actors as providing an “execution context”. That’s a term I would associate more with a thread or a task.

What actors provide is isolated access to the data they protect. That isolation is typically associated statically with a particular scope in your code, like the body of an actor function. These scopes must execute with that specific actor isolated, so when a task enters such a scope, it tries to isolate that actor, waiting (if necessary) until it’s available. The task later gives up that isolation when it enters a scope that requires a different isolation; it only ever runs with at most one actor isolated dynamically.

A function that isn’t isolated to some specific actor (i.e. a `nonisolated` function) generally just picks up the isolation of its caller dynamically. Statically, Swift doesn’t know what that isolation is, so it won’t let you do anything that would require some _specific_ isolation. That’s why your `static` function can’t read isolated properties from either of its actor arguments: you might call it from a function that has one of those actors isolated, but you also might not, and the static function wouldn’t know that in any case. (And since a task can only have one actor isolated at once, it could never have _both_ arguments isolated, which it would need to in order to compare their properties.)

But a `nonisolated` function does normally run with the right isolation dynamically, which means it’s fine for its caller to pass in data that wouldn’t otherwise be shareable, like non-sendable data that’s stored on the actor. Since the function will only ever run while the actor is isolated, it can always safely access that data.

The exception is when a function is explicitly `@concurrent`, in which case it really does run with no isolation dynamically. Swift will prevent you from sharing non-sendable actor-isolated data with such a function.

---

<div class="post-metadata">

**Author:** ![FranzBusch](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/franzbusch/32/19447_2.png) [@FranzBusch](https://forums.swift.org/u/FranzBusch)\
**Post date:** [November 20, 2025, 8:32pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/7 "2025-11-20T20:32:29Z")

</div>

> [@John\_McCall](#):
>
> But a `nonisolated` function does normally run with the right isolation dynamically, which means it’s fine for its caller to pass in data that wouldn’t otherwise be shareable, like non-sendable data that’s stored on the actor. Since the function will only ever run while the actor is isolated, it can always safely access that data.

I think you mean a `nonisolated(nonseding)` functions here. `nonisolated` functions are equivalent to `@concurrent` functions and they don't inherit any isolation.

---

<div class="post-metadata">

**Author:** ![hborla](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hborla/32/27563_2.png) [@hborla](https://forums.swift.org/u/hborla)\
**Post date:** [November 20, 2025, 8:34pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/8 "2025-11-20T20:34:38Z")

</div>

`nonisolated(nonsending)` exists only for transitioning to `NonisolatedNonsendingByDefault`. Once you enable that upcoming feauture (which is included in the Approachable Concurrency features), then yes, all `nonisolated` functions run wherever they're called from.

---

<div class="post-metadata">

**Author:** ![Christopher\_Kornher](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/christopher_kornher/32/600_2.png) [@Christopher\_Kornher](https://forums.swift.org/u/Christopher_Kornher)\
**Post date:** [November 20, 2025, 11:46pm UTC](https://forums.swift.org/t/question-about-actor-isolation-in-wwdc-video/83325/9 "2025-11-20T23:46:57Z")

</div>

> [@asaadjaber](#):
>
> > [@ibex](#):
> >
> > As you most likely already know, an actor has a message queue (or mailbox) that receives the execution requests which the actor handles one at a time in its execution context.

I hope that this isn’t being pedantic here, but if you are new to Swift actors, this can be surprising. Swift actors are reentrant – multiple actor methods can be in flight at the same time if some are marked as “async”. Actor methods marked as `async` can be suspended at `await` calls while other actor methods proceed. This differs from classic Erlang-style actors that process one message from their mailboxes at time. This was a conscious design decision and is well documented but can bite the unwary who think of actors as being completely protected from simultaneous access. Also, unlike some actor systems, Swift's actor "mailbox" system is opaque to application code.
