<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/concurrency",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Concurrency"
}
-->

# Concurrency

Perform asynchronous and parallel operations.

## Topics

### Essentials

  <doc://com.apple.Swift/documentation/Swift/code-along-elevating-an-app-with-swift-concurrency>

  <doc://com.apple.Swift/documentation/Swift/updating-an-app-to-use-strict-concurrency>

  <doc://com.apple.documentation/documentation/swift/updating_an_app_to_use_swift_concurrency>

### Tasks

[`Task`](/documentation/Swift/Task)

A unit of asynchronous work.

[`TaskGroup`](/documentation/Swift/TaskGroup)

A group that contains dynamically created child tasks.

[`withTaskGroup(of:returning:isolation:body:)`](/documentation/Swift/withTaskGroup(of:returning:isolation:body:))

Starts a new scope that can contain a dynamic number of child tasks.

[`ThrowingTaskGroup`](/documentation/Swift/ThrowingTaskGroup)

A group that contains throwing, dynamically created child tasks.

[`withThrowingTaskGroup(of:returning:isolation:body:)`](/documentation/Swift/withThrowingTaskGroup(of:returning:isolation:body:))

Starts a new scope that can contain a dynamic number of throwing child tasks.

[`TaskPriority`](/documentation/Swift/TaskPriority)

The priority of a task.

[`DiscardingTaskGroup`](/documentation/Swift/DiscardingTaskGroup)

A discarding group that contains dynamically created child tasks.

[`withDiscardingTaskGroup(returning:isolation:body:)`](/documentation/Swift/withDiscardingTaskGroup(returning:isolation:body:))

Starts a new scope that can contain a dynamic number of child tasks.

[`ThrowingDiscardingTaskGroup`](/documentation/Swift/ThrowingDiscardingTaskGroup)

A throwing discarding group that contains dynamically created child tasks.

[`withThrowingDiscardingTaskGroup(returning:isolation:body:)`](/documentation/Swift/withThrowingDiscardingTaskGroup(returning:isolation:body:))

Starts a new scope that can contain a dynamic number of child tasks.

[`UnsafeCurrentTask`](/documentation/Swift/UnsafeCurrentTask)

An unsafe reference to the current task.

### Asynchronous Sequences

[`AsyncSequence`](/documentation/Swift/AsyncSequence)

A type that provides asynchronous, sequential, iterated access to its
elements.

[`AsyncStream`](/documentation/Swift/AsyncStream)

An asynchronous sequence generated from a closure that calls a continuation
to produce new elements.

[`AsyncThrowingStream`](/documentation/Swift/AsyncThrowingStream)

An asynchronous sequence generated from an error-throwing closure that
calls a continuation to produce new elements.

### Continuations

[`CheckedContinuation`](/documentation/Swift/CheckedContinuation)

A mechanism to interface
between synchronous and asynchronous code,
logging correctness violations.

[`withCheckedContinuation(isolation:function:_:)`](/documentation/Swift/withCheckedContinuation(isolation:function:_:))

Invokes the passed in closure with a checked continuation for the current task.

[`withCheckedThrowingContinuation(isolation:function:_:)`](/documentation/Swift/withCheckedThrowingContinuation(isolation:function:_:))

Invokes the passed in closure with a checked continuation for the current task.

[`UnsafeContinuation`](/documentation/Swift/UnsafeContinuation)

A mechanism to interface
between synchronous and asynchronous code,
without correctness checking.

[`withUnsafeContinuation(isolation:_:)`](/documentation/Swift/withUnsafeContinuation(isolation:_:))

Invokes the passed in closure with a unsafe continuation for the current task.

[`UnsafeThrowingContinuation`](/documentation/Swift/UnsafeThrowingContinuation)

[`withUnsafeThrowingContinuation(isolation:_:)`](/documentation/Swift/withUnsafeThrowingContinuation(isolation:_:))

Invokes the passed in closure with a unsafe continuation for the current task.

### Actors

[`Sendable`](/documentation/Swift/Sendable)

A thread-safe type whose values can be shared across arbitrary concurrent
contexts without introducing a risk of data races.

[`Actor`](/documentation/Swift/Actor)

Common protocol to which all actors conform.

[`AnyActor`](/documentation/Swift/AnyActor)

Common marker protocol providing a shared “base” for both (local) `Actor`
and (potentially remote) `DistributedActor` types.

[`MainActor`](/documentation/Swift/MainActor)

A singleton actor whose executor is equivalent to the main
dispatch queue.

[`GlobalActor`](/documentation/Swift/GlobalActor)

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

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

A type whose metatype can be shared across arbitrary concurrent contexts
without introducing a risk of data races.

[`ConcurrentValue`](/documentation/Swift/ConcurrentValue)

[`UnsafeSendable`](/documentation/Swift/UnsafeSendable)

A type whose values can safely be passed across concurrency domains by copying,
but which disables some safety checking at the conformance site.

[`UnsafeConcurrentValue`](/documentation/Swift/UnsafeConcurrentValue)

[`isolation()`](/documentation/Swift/isolation())

Produce a reference to the actor to which the enclosing code is
isolated, or `nil` if the code is nonisolated.

[`extractIsolation(_:)`](/documentation/Swift/extractIsolation(_:))

### Task-Local Storage

[`TaskLocal`](/documentation/Swift/TaskLocal)

Wrapper type that defines a task-local value key.

[`TaskLocal()`](/documentation/Swift/TaskLocal())

Macro that introduces a [`TaskLocal`](/documentation/Swift/TaskLocal) binding.

### Executors

[`Executor`](/documentation/Swift/Executor)

A service that can execute jobs.

[`ExecutorJob`](/documentation/Swift/ExecutorJob)

A unit of schedulable work.

[`SerialExecutor`](/documentation/Swift/SerialExecutor)

A service that executes jobs.

[`TaskExecutor`](/documentation/Swift/TaskExecutor)

An executor that may be used as preferred executor by a task.

[`PartialAsyncTask`](/documentation/Swift/PartialAsyncTask)

[`UnownedJob`](/documentation/Swift/UnownedJob)

A unit of schedulable work.

[`JobPriority`](/documentation/Swift/JobPriority)

The priority of this job.

[`UnownedSerialExecutor`](/documentation/Swift/UnownedSerialExecutor)

An unowned reference to a serial executor (a `SerialExecutor`
value).

[`UnownedTaskExecutor`](/documentation/Swift/UnownedTaskExecutor)

[`globalConcurrentExecutor`](/documentation/Swift/globalConcurrentExecutor)

The global concurrent executor that is used by default for Swift Concurrency
tasks.

[`withTaskExecutorPreference(_:isolation:operation:)`](/documentation/Swift/withTaskExecutorPreference(_:isolation:operation:))

Configure the current task hierarchy’s task executor preference to the passed [`TaskExecutor`](/documentation/Swift/TaskExecutor),
and execute the passed in closure by immediately hopping to that executor.

### Main and Task Executors

### Deprecated

[`Job`](/documentation/Swift/Job)

Deprecated equivalent of [`ExecutorJob`](/documentation/Swift/ExecutorJob).



---

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)
