<!-- llms-explorer concept facts · https://llms-explorer.com/tree/mlx-new-thread-unsafe-stream-api-and-swift-concu/ · pack 2026-10-05 · ~577 tokens -->

# MLX new_thread_unsafe_stream API and Swift concurrency use

> The PR text says the streams "can be freely passed to and evaluated on any thread" with no MLX synchronization, and that it gives language bindings such as Swift a way to evaluate graphs asynchronously through threads provided they add their own locks.

Parent: [Mac local LLMs: MLX kernels, numerics and internals](https://llms-explorer.com/tree/mac-local-llms-mlx-kernels-numerics-and-internals/) · 1 facets · 9 facts · page: https://llms-explorer.com/tree/mlx-new-thread-unsafe-stream-api-and-swift-concu/

## Facts

- The PR text says the streams "can be freely passed to and evaluated on any thread" with no MLX synchronization, and that it gives language bindings such as Swift a way to evaluate graphs asynchronously through threads provided they add their own locks. — [source](https://github.com/ml-explore/mlx/pull/3578)
- The author hopes fully thread-safe streams later let the API be removed, but calls that "very tricky". — [source](https://github.com/ml-explore/mlx/pull/3578)
- PR 3578 was opened 2026-05-21 by zcbenz, force-pushed twice (to ddd7b95 on 2026-05-22 and 0f1191e on 2026-06-17), approved by angeloskath on 2026-06-16 ("Looks great!") and merged 2026-06-17 as commit 693ed59. — [source](https://github.com/ml-explore/mlx/pull/3578)
- mlx-swift maintainer davidkoski cross-referenced it on 2026-06-04 from mlx-swift issue 407 (check_error() throws std::runtime_error from a completion handler, SIGABRT on iPhone 15 Pro, iOS 26.4, Qwen3 1.7B 4-bit). — [source](https://github.com/ml-explore/mlx/pull/3578)
- No mlx-swift release or adoption of the API was found in sources read. — source: `asserted`
- PR 3578 targets Swift-style concurrency where evaluation moves between threads, with locking left to the caller. — [source](https://github.com/ml-explore/mlx/pull/3578)
- PR 3578 merged as commit 693ed59 on 2026-06-17 after angeloskath's approval on 2026-06-16. — [source](https://github.com/ml-explore/mlx/pull/3578)
- mlx-swift issue 407 (completion-handler SIGABRT) was linked to PR 3578 by davidkoski on 2026-06-04. — [source](https://github.com/ml-explore/mlx/pull/3578)
- The API is described by its author as a stopgap pending true thread-safe streams. — [source](https://github.com/ml-explore/mlx/pull/3578)
