<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/GlobalActor",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:12_Concurrency11GlobalActorP"
  },
  "title" : "GlobalActor"
}
-->

# GlobalActor

A type that represents a globally-unique actor that can be used to isolate
various declarations anywhere in the program.

```
protocol GlobalActor
```

## Overview

A type that conforms to the `GlobalActor` protocol and is marked with
the `@globalActor` attribute can be used as a custom attribute. Such types
are called global actor types, and can be applied to any declaration to
specify that such types are isolated to that global actor type. When using
such a declaration from another actor (or from nonisolated code),
synchronization is performed through the shared actor instance to ensure
mutually-exclusive access to the declaration.

## Custom Actor Executors

A global actor uses a custom executor if it needs to customize its execution
semantics, for example, by making sure all of its invocations are run on a
specific thread or dispatch queue.

This is done the same way as with normal non-global actors, by declaring a
[`unownedExecutor`](/documentation/Swift/Actor/unownedExecutor) nonisolated property in the [`ActorType`](/documentation/Swift/GlobalActor/ActorType)
underlying this global actor.

It is *not* necessary to override the [`sharedUnownedExecutor`](/documentation/Swift/GlobalActor/sharedUnownedExecutor) static
property of the global actor, as its default implementation already
delegates to the `shared.unownedExecutor`, which is the most reasonable
and correct implementation of this protocol requirement.

You can find out more about custom executors, by referring to the
[`SerialExecutor`](/documentation/Swift/SerialExecutor) protocol’s documentation.

> SeeAlso: ``doc://com.apple.Swift/documentation/Swift/SerialExecutor``

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)