# Deadlock When Using DispatchQueue from Swift Task

**URL:** <https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058>\
**Category:** Using Swift\
**Tags:** concurrency, libdispatch\
**Created:** [July 9, 2023, 11:17am UTC](https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058 "2023-07-09T11:17:06Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![John\_McCall](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/john_mccall/32/1351_2.png) [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Post date:** [July 10, 2023, 4:30pm UTC](https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058/19 "2023-07-10T16:30:25Z")

</div>

`DispatchQueue` is over-committing, but if you’re enqueuing to a queue with `queue.sync`, you’re also tying up a thread that may be from an executor that is not. `sync` has the isolation properties of the queue but doesn’t change the underlying reality of what thread you’re on.

---

_[View the full topic](https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058)._
