<!--
{
  "documentType" : "article",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/dispatch-group",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Dispatch Group"
}
-->

# Dispatch Group

A group of tasks that you monitor as a single unit.

## Discussion

Groups allow you to aggregate a set of tasks and synchronize behaviors on the group. You attach multiple blocks to a group and schedule them for asynchronous execution on the same queue or different queues. When all blocks finish executing, the group executes its completion handler. You can also wait synchronously for all blocks in the group to finish executing.

## Topics

### Creating a Dispatch Group

[`dispatch_group_create`](/documentation/Dispatch/DispatchGroup/init())

Creates a new group to which you can assign block objects.

[`dispatch_group_t`](/documentation/Dispatch/dispatch_group_t)

A group of block objects submitted to a queue for asynchronous invocation.

[`OS_dispatch_group`](/documentation/Dispatch/OS_dispatch_group)

### Adding Work to the Group

[`dispatch_group_async`](/documentation/Dispatch/dispatch_group_async)

Schedules a block asynchronously for execution and simultaneously associates it with the specified dispatch group.

[`dispatch_group_async_f`](/documentation/Dispatch/dispatch_group_async_f)

Submits an application-defined function to a dispatch queue and associates it with the specified dispatch group.

### Adding a Completion Handler

[`dispatch_group_notify`](/documentation/Dispatch/dispatch_group_notify)

Schedules a block object to be submitted to a queue when a group of previously submitted block objects have completed.

[`dispatch_group_notify_f`](/documentation/Dispatch/dispatch_group_notify_f)

Schedules an application-defined function to be submitted to a queue when a group of previously submitted block objects have completed.

### Waiting for Tasks to Finish Executing

[`dispatch_group_wait`](/documentation/Dispatch/dispatch_group_wait)

Waits synchronously for the previously submitted block objects to finish; returns if the blocks do not complete before the specified timeout period has elapsed.

### Updating the Group Manually

[`dispatch_group_enter`](/documentation/Dispatch/DispatchGroup/enter())

Explicitly indicates that a block has entered the group.

[`dispatch_group_leave`](/documentation/Dispatch/DispatchGroup/leave())

Explicitly indicates that a block in the group finished executing.



---

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)