<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLCommandQueue"
  },
  "title" : "MTLCommandQueue"
}
-->

# MTLCommandQueue

An instance you use to create, submit, and schedule command buffers to a specific GPU device to run the commands within those buffers.

```
protocol MTLCommandQueue : NSObjectProtocol, Sendable
```

## Overview

A command queue maintains an ordered list of command buffers. You use a command queue to:

- Create command buffers, which you fill with commands for the GPU device that creates the queue
- Submit command buffers to run on that GPU

Create a command queue from an [`MTLDevice`](/documentation/Metal/MTLDevice) instance by calling its [`makeCommandQueue()`](/documentation/Metal/MTLDevice/makeCommandQueue()) or [`makeCommandQueue(maxCommandBufferCount:)`](/documentation/Metal/MTLDevice/makeCommandQueue(maxCommandBufferCount:)) method. Typically, you create one or more command queues when your app launches and then keep them throughout your app’s lifetime.

With each [`MTLCommandQueue`](/documentation/Metal/MTLCommandQueue) instance you create, you can create [`MTLCommandBuffer`](/documentation/Metal/MTLCommandBuffer) instances for that queue by calling its [`makeCommandBuffer()`](/documentation/Metal/MTLCommandQueue/makeCommandBuffer()) or [`makeCommandBufferWithUnretainedReferences()`](/documentation/Metal/MTLCommandQueue/makeCommandBufferWithUnretainedReferences()) method.

> Note:
> Each command queue is thread-safe and allows you to encode commands in multiple command buffers simultaneously.

For more information about command buffers and encoding GPU commands to them — such as rendering images and computing data in parallel — see [Setting up a command structure](/documentation/Metal/setting-up-a-command-structure).

## Topics

### Creating command buffers

[`makeCommandBuffer(descriptor:)`](/documentation/Metal/MTLCommandQueue/makeCommandBuffer(descriptor:))

Returns a command buffer from the command queue that you configure with a descriptor.

[`makeCommandBuffer()`](/documentation/Metal/MTLCommandQueue/makeCommandBuffer())

Returns a command buffer from the command queue that maintains strong references to resources.

[`makeCommandBufferWithUnretainedReferences()`](/documentation/Metal/MTLCommandQueue/makeCommandBufferWithUnretainedReferences())

Returns a command buffer from the command queue that doesn’t maintain strong references to resources.

### Attaching residency sets

[`addResidencySet(_:)`](/documentation/Metal/MTLCommandQueue/addResidencySet(_:))

Applies a residency set to a queue, which Metal applies to the queue’s command buffers as you commit them.

[`addResidencySets(_:)`](/documentation/Metal/MTLCommandQueue/addResidencySets(_:))

Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.

[`addResidencySets:count:`](/documentation/Metal/MTLCommandQueue/addResidencySets:count:)

Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.

### Detaching residency sets

[`removeResidencySet(_:)`](/documentation/Metal/MTLCommandQueue/removeResidencySet(_:))

Removes a residency set from a command queue’s list,
which means Metal doesn’t apply it to the queue’s command buffers as you commit them.

[`removeResidencySets(_:)`](/documentation/Metal/MTLCommandQueue/removeResidencySets(_:))

Removes multiple residency sets from a command queue’s list,
which means Metal doesn’t apply them to the queue’s command buffers as you commit them.

[`removeResidencySets:count:`](/documentation/Metal/MTLCommandQueue/removeResidencySets:count:)

Removes multiple residency sets from a command queue’s list,
which means Metal doesn’t apply them to the queue’s command buffers as you commit them.

### Identifying the command queue

[`device`](/documentation/Metal/MTLCommandQueue/device)

The GPU device that creates the command queue.

[`label`](/documentation/Metal/MTLCommandQueue/label)

An optional name that can help you identify the command queue.

### Deprecated

[`insertDebugCaptureBoundary()`](/documentation/Metal/MTLCommandQueue/insertDebugCaptureBoundary())

Informs Xcode about when GPU Frame Capture starts and stops.



---

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)