<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/OperationQueue/underlyingQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOperationQueue(py)underlyingQueue"
  },
  "title" : "underlyingQueue"
}
-->

# underlyingQueue

The dispatch queue that the operation queue uses to invoke operations.

```
unowned(unsafe) var underlyingQueue: dispatch_queue_t? { get set }
```

## Discussion

The default value of this property is `nil`. You can set the value of this property to an existing dispatch queue to have enqueued operations interspersed with blocks submitted to that dispatch queue.

The value of this property should only be set if there are no operations in the queue; setting the value of this property when [`operationCount`](/documentation/Foundation/OperationQueue/operationCount) is not equal to `0` raises an [`invalidArgumentException`](/documentation/Foundation/NSExceptionName/invalidArgumentException). The value of this property must not be the value returned by <doc://com.apple.documentation/documentation/Dispatch/dispatch_get_main_queue>. The quality-of-service level set for the underlying dispatch queue overrides any value set for the operation queue’s [`qualityOfService`](/documentation/Foundation/OperationQueue/qualityOfService) property.

> Note:
> This property automatically retains its assigned queue if `OS_OBJECT_IS_OBJC` is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)