# \#libdispatch

**URL:** https://forums.swift.org/tag/libdispatch/251.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Deadlock When Using DispatchQueue from Swift Task](https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058)

<div class="topic-metadata">

**Author:** [@nsc](https://forums.swift.org/u/nsc)\
**Replies:** 50\
**Last updated:** [June 17, 2026, 5:31pm UTC](https://forums.swift.org/t/deadlock-when-using-dispatchqueue-from-swift-task/66058 "2026-06-17T17:31:17Z")

</div>

I have a subsystem that is using a reader-writer scheme using barriers to manage access to a shared resource. When I use said subsystem from a TaskGroup it often deadlocks. The code basically boils down to the following…

---

## [A "zombie" \`faked\` process never exits when running \`fakeroot\` from a \`Process\` only in an async context on linux](https://forums.swift.org/t/a-zombie-faked-process-never-exits-when-running-fakeroot-from-a-process-only-in-an-async-context-on-linux/79638)

<div class="topic-metadata">

**Author:** [@Candygoblen123](https://forums.swift.org/u/Candygoblen123)\
**Replies:** 0\
**Last updated:** [May 2, 2025, 4:01pm UTC](https://forums.swift.org/t/a-zombie-faked-process-never-exits-when-running-fakeroot-from-a-process-only-in-an-async-context-on-linux/79638 "2025-05-02T16:01:56Z")

</div>

I have a program that launches a Process that runs the fakeroot command in order to safely check for package updates without requiring root. However, when I made it into a systemd service, I noticed that it was spawning …

---

## [Custom DispatchQueue using main thread](https://forums.swift.org/t/custom-dispatchqueue-using-main-thread/76554)

<div class="topic-metadata">

**Author:** [@piyush\_singh](https://forums.swift.org/u/piyush_singh)\
**Replies:** 9\
**Last updated:** [December 18, 2024, 9:14pm UTC](https://forums.swift.org/t/custom-dispatchqueue-using-main-thread/76554 "2024-12-18T21:14:44Z")

</div>

Today I found one custom serial DispatchQueue queue in our app using Thread 1 to execute its' work. The function had an assertion to make sure it wasn't executing on the main thread. The assertion failed. My question: …

---

## [Using DispatchQueue as actor's serial executor under Linux](https://forums.swift.org/t/using-dispatchqueue-as-actors-serial-executor-under-linux/75260)

<div class="topic-metadata">

**Author:** [@mman](https://forums.swift.org/u/mman)\
**Replies:** 2\
**Last updated:** [October 14, 2024, 9:41am UTC](https://forums.swift.org/t/using-dispatchqueue-as-actors-serial-executor-under-linux/75260 "2024-10-14T09:41:22Z")

</div>

I am trying to make an actor backed by serial DispatchQueue so that I can interoperate with legacy queue based code, but the following example working under macOS fails under Linux. Am I holding it wrong? public actor …

---

## [URLSessionTasks on Windows can cause crashes](https://forums.swift.org/t/urlsessiontasks-on-windows-can-cause-crashes/64795)

<div class="topic-metadata">

**Author:** [@gregcotten](https://forums.swift.org/u/gregcotten)\
**Replies:** 2\
**Last updated:** [July 18, 2024, 7:11pm UTC](https://forums.swift.org/t/urlsessiontasks-on-windows-can-cause-crashes/64795 "2024-07-18T19:11:08Z")

</div>

I am having a hard time attempting to use Swift in a production app on Windows! It turns out if your URLSessionTask fails due to a timeout, instead of completing with an error I instead get a total crash. I thought I'd…

---

## [What's the best practices For GCD?](https://forums.swift.org/t/whats-the-best-practices-for-gcd/73020)

<div class="topic-metadata">

**Author:** [@Ethan](https://forums.swift.org/u/Ethan)\
**Replies:** 1\
**Last updated:** [July 8, 2024, 4:31pm UTC](https://forums.swift.org/t/whats-the-best-practices-for-gcd/73020 "2024-07-08T16:31:03Z")

</div>

Hi Swift Community! I'm trying to understand the best practices for using GCD after watching Modernizing Grand Central Dispatch Usage and reading the discussion here and here. So it seems like using custom serial queue…

---

## [Swift Macros / Property Wrappers to help use DispatchQueue correctly?](https://forums.swift.org/t/swift-macros-property-wrappers-to-help-use-dispatchqueue-correctly/71792)

<div class="topic-metadata">

**Author:** [@mman](https://forums.swift.org/u/mman)\
**Replies:** 1\
**Last updated:** [May 15, 2024, 1:37am UTC](https://forums.swift.org/t/swift-macros-property-wrappers-to-help-use-dispatchqueue-correctly/71792 "2024-05-15T01:37:23Z")

</div>

Hi guys, My existing concurrent code uses a lot of traditional DispatchQueue patterns, from using a serial dispatch queue to protect internal state to callbacks to user specified callback queues. I am trying to bring t…

---

## [Is it safe to cast DispatchData to Data this way?](https://forums.swift.org/t/is-it-safe-to-cast-dispatchdata-to-data-this-way/44262)

<div class="topic-metadata">

**Author:** [@ken](https://forums.swift.org/u/ken)\
**Replies:** 11\
**Last updated:** [February 2, 2021, 2:46am UTC](https://forums.swift.org/t/is-it-safe-to-cast-dispatchdata-to-data-this-way/44262 "2021-02-02T02:46:21Z")

</div>

Hi. I'm writing a program that used to use (NS)InputStream to read a file, and I'm upgrading it to use DispatchIO. WWDC 2013 #704 showed an example of how to do this, but of course that was pre-Swift. You pass an Obje…

---

## [Libdispatch and REPL](https://forums.swift.org/t/libdispatch-and-repl/35070)

<div class="topic-metadata">

**Author:** [@rex-remind](https://forums.swift.org/u/rex-remind)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 9:36am UTC](https://forums.swift.org/t/libdispatch-and-repl/35070 "2020-04-05T09:36:42Z")

</div>

Doesn't look like libdispatch interacts well with the REPL. 1\> import Foundation 2\> DispatchQueue.global(qos: .userInitiated).async { print("what") } never prints. Anything that can be done to fix?

---

## [Using Dispatch Internals for Testing](https://forums.swift.org/t/using-dispatch-internals-for-testing/34769)

<div class="topic-metadata">

**Author:** [@SlaunchaMan](https://forums.swift.org/u/SlaunchaMan)\
**Replies:** 1\
**Last updated:** [March 25, 2020, 9:07am UTC](https://forums.swift.org/t/using-dispatch-internals-for-testing/34769 "2020-03-25T09:07:33Z")

</div>

After the release of my ErrorAssertions package that allows you to write tests around places your code calls fatalError() and friends, I turned my attention to another assertion method in Swift: Dispatch’s dispatchPrecon…

---

## [Building libDispatch on Linux crashes](https://forums.swift.org/t/building-libdispatch-on-linux-crashes/34319)

<div class="topic-metadata">

**Author:** [@Ron\_Olson](https://forums.swift.org/u/Ron_Olson)\
**Replies:** 14\
**Last updated:** [March 9, 2020, 1:01am UTC](https://forums.swift.org/t/building-libdispatch-on-linux-crashes/34319 "2020-03-09T01:01:43Z")

</div>

Hey all- Okay, I'm at Witt's End and am making a request for some help. I am trying to build Swift 5.2 on Fedora Rawhide that has Clang 10 and CMake 3.17.0-rc2 as of this writing. It fails to build libDispatch because s…

---

## [(Partial) Nightlies for android SDK](https://forums.swift.org/t/partial-nightlies-for-android-sdk/25909)

<div class="topic-metadata">

**Author:** [@compnerd](https://forums.swift.org/u/compnerd)\
**Replies:** 42\
**Last updated:** [August 12, 2019, 3:46pm UTC](https://forums.swift.org/t/partial-nightlies-for-android-sdk/25909 "2019-08-12T15:46:43Z")

</div>

Hello android developers, I often hear that android users tend to have a hard time with getting started with using swift on android. Part of this stems from people not wanting to build the full toolchain, part of it st…

---

## [What does Swift support in CMake mean for Swift's build?](https://forums.swift.org/t/what-does-swift-support-in-cmake-mean-for-swifts-build/24828)

<div class="topic-metadata">

**Author:** [@compnerd](https://forums.swift.org/u/compnerd)\
**Replies:** 18\
**Last updated:** [June 27, 2019, 1:14am UTC](https://forums.swift.org/t/what-does-swift-support-in-cmake-mean-for-swifts-build/24828 "2019-06-27T01:14:47Z")

</div>

On the heels of the recent announcement about Swift support in CMake, I would like to bring up a topic of discussion which I think may take a bit to resolve. I would like to bring this topic up and see if we can come to…

---

## [DISPATCH\_INTERNAL\_CRASH on \_dispatch\_queue\_cleanup](https://forums.swift.org/t/dispatch-internal-crash-on-dispatch-queue-cleanup/25055)

<div class="topic-metadata">

**Author:** [@VolodymyrBoichentsov](https://forums.swift.org/u/VolodymyrBoichentsov)\
**Replies:** 8\
**Last updated:** [June 1, 2019, 9:37pm UTC](https://forums.swift.org/t/dispatch-internal-crash-on-dispatch-queue-cleanup/25055 "2019-06-01T21:37:55Z")

</div>

I'm getting crash on pthread\_exit for one of threads which was spawned by dispatch. This thread is next to above and looks healty: configuration of cmake: cmake -DANDROID\_PLATFORM="android-$ANDROID\_PLATFORM" \\…
