---
title: GlobalActor
framework: swift
role: symbol
role_heading: Protocol
path: swift/globalactor
---

# GlobalActor

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

## Declaration

```swift
protocol GlobalActor
```

## Overview

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 nonisolated property in the ActorType underlying this global actor. It is not necessary to override the 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 protocol’s documentation. note: SerialExecutor

## Topics

### Associated Types

- [ActorType](swift/globalactor/actortype.md)

### Type Properties

- [shared](swift/globalactor/shared.md)
- [sharedUnownedExecutor](swift/globalactor/sharedunownedexecutor.md)

### Type Methods

- [assertIsolated(_:file:line:)](swift/globalactor/assertisolated(_:file:line:).md)
- [preconditionIsolated(_:file:line:)](swift/globalactor/preconditionisolated(_:file:line:).md)

## Relationships

### Conforming Types

- [MainActor](swift/mainactor.md)

## See Also

### Actors

- [Sendable](swift/sendable.md)
- [Actor](swift/actor.md)
- [AnyActor](swift/anyactor.md)
- [MainActor](swift/mainactor.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [ConcurrentValue](swift/concurrentvalue.md)
- [UnsafeSendable](swift/unsafesendable.md)
- [UnsafeConcurrentValue](swift/unsafeconcurrentvalue.md)
- [isolation()](swift/isolation().md)
- [extractIsolation(_:)](swift/extractisolation(_:).md)
