Working with Different Threads in Swift TurboModules

TurboModules give you direct access to native APIs, but performance and correctness depend heavily on where that code runs. In this episode, Oskar Kwaśniewski breaks down the threading model behind React Native TurboModules on iOS and shows how to safely move work across JavaScript, native module, background, and main threads using Swift and Grand Central Dispatch.
Using the Local Storage TurboModule from earlier episodes, Oskar demonstrates how synchronous and asynchronous methods behave, how blocking the JavaScript thread can freeze your app, and how to offload heavy work to background or custom queues while keeping the UI responsive.
Understanding React Native threads on iOS
Oskar starts by mapping out the three core threads you interact with in a React Native app on iOS: the main (UI) thread, the JavaScript thread, and the native modules thread pool. He explains what each thread is responsible for and why accessing UIKit must always happen on the main thread, while heavy computation should never run on the JS thread.
Checking which thread your TurboModule runs on
To make thread behavior visible, Oskar adds simple logging and debugger breakpoints to inspect the current thread at runtime. He shows how synchronous TurboModule methods execute directly on the JavaScript thread, while async methods are dispatched through the TurboModule manager queue.
Why blocking the JavaScript thread is dangerous
By intentionally calling Thread.sleep in a synchronous method, Oskar demonstrates how easily the JavaScript thread can be blocked and how that immediately makes the app unresponsive. This example highlights the most important takeaway of the episode: never perform long‑running work on the JS or main thread.
Introducing Grand Central Dispatch (GCD)
Oskar introduces Grand Central Dispatch as the foundation for concurrency in Swift. Instead of managing threads manually, you submit closures to dispatch queues and let the system schedule work efficiently. He explains how global queues work and how Quality of Service (QoS) affects task priority.
Jumping between background and main threads
Using DispatchQueue.global().async and DispatchQueue.main.async, Oskar shows how to move work off the JavaScript thread, perform background processing, and then safely return to the main thread to update UI‑related state.
Serial vs concurrent custom queues
The episode then dives into custom dispatch queues. Oskar creates a private serial queue to demonstrate predictable, ordered execution, then switches it to a concurrent queue to show how multiple tasks can run in parallel. He explains when each approach makes sense, such as serial access to shared state versus parallel batch processing.
Implementing async TurboModule methods
Finally, Oskar adds asynchronous versions of getItem and setItem to the TurboModule. He walks through the Codegen‑generated Objective‑C interfaces, bridging promise‑based methods to Swift, and resolving promises from a background or custom queue without blocking React Native’s internal thread pools.
Key takeaways
- Synchronous TurboModule methods run on the JavaScript thread and must be fast.
- Never block the JavaScript or main thread with heavy work.
- Use GCD global or custom queues for long‑running tasks.
- Async TurboModule methods let you safely offload work and resolve results later.
Resources
- Oskar Kwaśniewski on X and GitHub
- Other episodes in this series
- Tools & libraries:
- TurboModules (New Architecture)
- Codegen
- Swift + Objective‑C interop
- Grand Central Dispatch (GCD)
Learn more about React Native
Stay up to date with our latest insights on React, React Native, and cross-platform development from the people who build the technology and scale with it daily.
Learn more about React Native

React Native Wrapped 2025: A Month-by-Month Recap of The Year
The first edition of React Native Wrapped looks back at the year RN turned 10 and the ecosystem doubled down on the New Architecture. It provides a month-by-month record of 2025, covering major framework releases, the Legacy Architecture freeze, React 19 integration, and notable developments across tooling, performance, styling, native modules, Expo, and platform adoption.

Building v0 iOS and Fixing React Native Along the Way
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Shipping iOS Live Activities with React: The Voltra Story
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Scaling React Native at Zalando: How Brownfield Migration Paid Off
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.












