---
title: MTLCommandQueue
framework: metal
role: symbol
role_heading: Protocol
path: metal/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.

## Declaration

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

## Mentioned in

Understanding the Metal 4 core API Simplifying GPU resource management with residency sets

## Overview

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 instance by calling its makeCommandQueue() or 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 instance you create, you can create MTLCommandBuffer instances for that queue by calling its makeCommandBuffer() or 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.

## Topics

### Creating command buffers

- [makeCommandBuffer(descriptor:)](metal/mtlcommandqueue/makecommandbuffer(descriptor:).md)
- [makeCommandBuffer()](metal/mtlcommandqueue/makecommandbuffer().md)
- [makeCommandBufferWithUnretainedReferences()](metal/mtlcommandqueue/makecommandbufferwithunretainedreferences().md)

### Attaching residency sets

- [addResidencySet(_:)](metal/mtlcommandqueue/addresidencyset(_:).md)
- [addResidencySets(_:)](metal/mtlcommandqueue/addresidencysets(_:).md)

### Detaching residency sets

- [removeResidencySet(_:)](metal/mtlcommandqueue/removeresidencyset(_:).md)
- [removeResidencySets(_:)](metal/mtlcommandqueue/removeresidencysets(_:).md)

### Identifying the command queue

- [device](metal/mtlcommandqueue/device.md)
- [label](metal/mtlcommandqueue/label.md)

### Deprecated

- [insertDebugCaptureBoundary()](metal/mtlcommandqueue/insertdebugcaptureboundary().md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Submitting work to a GPU with Metal

- [Setting up a command structure](metal/setting-up-a-command-structure.md)
- [MTLCommandQueueDescriptor](metal/mtlcommandqueuedescriptor.md)
- [MTLCommandBuffer](metal/mtlcommandbuffer.md)
- [MTLCommandBufferDescriptor](metal/mtlcommandbufferdescriptor.md)
- [MTLCommandBufferError](metal/mtlcommandbuffererror-swift.struct.md)
- [MTLCommandEncoder](metal/mtlcommandencoder.md)
