# multithreading

Multithreading is a programming paradigm in which multiple threads execute concurrently within a program, supported by primitives for creating and coordinating threads.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## AMD Zen 6 SMT Proves Very Advantageous Even For 256 Core EPYC 9996

DevFeed: [AMD Zen 6 SMT Proves Very Advantageous Even For 256 Core EPYC 9996](<https://devfeed.tech/articles/amd-zen-6-smt-proves-very-advantageous-even-for-256-core-epyc-9996-130579.md>)

Original publisher: [Read original article](<https://www.phoronix.com/review/amd-epyc-zen6-smt>)

Author: Michael Larabel

Published: 2026-11-12T16:40:00Z

Content type: article

Language: en

Sources: [Phoronix](<https://devfeed.tech/sources/phoronix.md>)

Topics: [multithreading](<https://devfeed.tech/topics/multithreading.md>)

Tags: [amd](<https://devfeed.tech/tags/amd.md>), [amd-epyc](<https://devfeed.tech/tags/amd-epyc.md>), [amd-epyc-processors](<https://devfeed.tech/tags/amd-epyc-processors.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [desktop-linux](<https://devfeed.tech/tags/desktop-linux.md>), [epyc](<https://devfeed.tech/tags/epyc.md>), [exploring](<https://devfeed.tech/tags/exploring.md>), [granite-rapids](<https://devfeed.tech/tags/granite-rapids.md>), [intel](<https://devfeed.tech/tags/intel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-benchmarking](<https://devfeed.tech/tags/linux-benchmarking.md>), [linux-hardware-benchmarks](<https://devfeed.tech/tags/linux-hardware-benchmarks.md>), [linux-hardware-reviews](<https://devfeed.tech/tags/linux-hardware-reviews.md>), [linux-how-to](<https://devfeed.tech/tags/linux-how-to.md>), [linux-performance](<https://devfeed.tech/tags/linux-performance.md>), [linux-server-benchmarks](<https://devfeed.tech/tags/linux-server-benchmarks.md>), [nvidia](<https://devfeed.tech/tags/nvidia.md>), [open-source-graphics](<https://devfeed.tech/tags/open-source-graphics.md>), [performance](<https://devfeed.tech/tags/performance.md>), [phoronix](<https://devfeed.tech/tags/phoronix.md>), [phoronix-test-suite](<https://devfeed.tech/tags/phoronix-test-suite.md>), [power](<https://devfeed.tech/tags/power.md>), [server](<https://devfeed.tech/tags/server.md>), [smt](<https://devfeed.tech/tags/smt.md>), [sp7](<https://devfeed.tech/tags/sp7.md>), [ubuntu-benchmarks](<https://devfeed.tech/tags/ubuntu-benchmarks.md>), [ubuntu-hardware](<https://devfeed.tech/tags/ubuntu-hardware.md>), [venice](<https://devfeed.tech/tags/venice.md>), [zen-6](<https://devfeed.tech/tags/zen-6.md>)

### AI overview

Benchmarks on dual-socket AMD EPYC 9686F (192 cores) and EPYC 9996 (512 cores) compared default SMT-on operation with SMT disabled, measuring performance and combined CPU power. The workloads included scalable tests, some capable of using roughly 1,024 threads on the 9996, alongside applications limited by thread caps or scaling challenges. Tests ran on Ubuntu 26.10 with Linux 7.3. The source summary reports that SMT remained worthwhile for performance and performance per watt, including on the 256-core-per-socket Zen 6 processor; the supplied excerpt gives no per-workload results or numerical gains.

### Source excerpt

With the now-shipping AMD EPYC 9006 "Venice" SP7 server processors sporting up to 256 Zen 6(C) cores per socket, or 512 cores in a 2P configuration, you may be wondering if Simultaneous Multithreading (SMT) is still worthwhile on these increasingly high core count processors. Long story short, SMT on AMD Zen 6 is still definitely worthwhile from a performance and power perspective. I was curious myself and ran some benchmarks to explore the SMT impact on the 256-core EPYC 9996 as well as the 96-core high frequency EPYC 9686F processors.

## An Intro to Threading in Python

DevFeed: [An Intro to Threading in Python](<https://devfeed.tech/articles/an-intro-to-threading-in-python-98857.md>)

Original publisher: [Read original article](<https://realpython.com/intro-to-python-threading/>)

Author: Jim Anderson

Published: 2026-10-24T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Python](<https://devfeed.tech/topics/python.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [shared mutable state](<https://devfeed.tech/topics/shared-mutable-state.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [concurrently](<https://devfeed.tech/tags/concurrently.md>), [deadlocks](<https://devfeed.tech/tags/deadlocks.md>), [locks](<https://devfeed.tech/tags/locks.md>), [python](<https://devfeed.tech/tags/python.md>), [python-threading](<https://devfeed.tech/tags/python-threading.md>), [queues](<https://devfeed.tech/tags/queues.md>), [race-conditions](<https://devfeed.tech/tags/race-conditions.md>), [threading](<https://devfeed.tech/tags/threading.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

Python threading can simplify concurrent program design and is most useful for tasks that spend time waiting on external events. In standard CPython builds, the GIL generally prevents Python threads from running CPU-bound code in parallel; the optional free-threaded build introduced in Python 3.13 is an exception. The tutorial shows how to start threads and wait with `join()`, and how `ThreadPoolExecutor` manages a group of workers. It demonstrates a lost update when threads share mutable data, then uses `Lock` to protect the read-modify-write section. A `Lock` used as a context manager is released when the block exits; `RLock` supports repeated acquisition by the same thread. For producer-consumer work, a single-slot lock-based pipeline cannot absorb bursts, while thread-safe `queue.Queue` can buffer messages and block at a configured maximum size; an `Event` signals shutdown, and the consumer drains queued messages before exiting. The article also surveys `Semaphore` for limiting access to finite resources, `Timer` for delayed calls, and `Barrier` for synchronizing a fixed number of threads.

### Source excerpt

Learn how to use Python threading to run tasks concurrently, synchronize threads with locks and queues, and avoid race conditions and deadlocks.

## Speed Up Your Python Program With Concurrency

DevFeed: [Speed Up Your Python Program With Concurrency](<https://devfeed.tech/articles/speed-up-your-python-program-with-concurrency-95793.md>)

Original publisher: [Read original article](<https://realpython.com/python-concurrency/>)

Author: Jim Anderson

Published: 2026-10-22T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>), [async](<https://devfeed.tech/topics/async.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Process](<https://devfeed.tech/topics/process.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [asynchronous-programming](<https://devfeed.tech/tags/asynchronous-programming.md>), [asyncio](<https://devfeed.tech/tags/asyncio.md>), [await](<https://devfeed.tech/tags/await.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [i-o](<https://devfeed.tech/tags/i-o.md>), [multiprocessing](<https://devfeed.tech/tags/multiprocessing.md>), [python](<https://devfeed.tech/tags/python.md>), [threading](<https://devfeed.tech/tags/threading.md>)

### AI overview

For I/O-bound work, concurrency speeds programs by overlapping time spent waiting; for CPU-bound work in CPython, separate processes can run tasks across CPU cores. The tutorial compares a sequential downloader (about 14 seconds for 160 requests), a five-thread version (about 3.2 seconds), an `asyncio` version using the non-blocking `aiohttp` library (about 0.5 seconds), and a process pool (about 3.4 seconds). Threads require care with shared state and can introduce race conditions; asynchronous tasks scale with less overhead but need non-blocking libraries and can stall if a task fails to yield. For a recursive Fibonacci workload, threads were slightly slower than sequential execution and `asyncio` was much slower, while a process pool reduced runtime from about 35 to 10 seconds. Process pools add setup and communication costs, so the article recommends first confirming a performance problem, then matching the model to whether the workload waits on I/O or uses the CPU.

### Source excerpt

Explore Python concurrency with threading, asyncio, and multiprocessing, and learn which model speeds up your I/O-bound or CPU-bound programs.

## NVIDIA Vera SMT Performance Benchmarks

DevFeed: [NVIDIA Vera SMT Performance Benchmarks](<https://devfeed.tech/articles/nvidia-vera-smt-performance-benchmarks-61248.md>)

Original publisher: [Read original article](<https://www.phoronix.com/review/nvidia-vera-smt>)

Author: Michael Larabel

Published: 2026-09-28T12:54:23Z

Content type: article

Language: en

Sources: [Phoronix](<https://devfeed.tech/sources/phoronix.md>)

Topics: [NVIDIA Vera](<https://devfeed.tech/topics/nvidia-vera.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [Processor Affinity](<https://devfeed.tech/topics/processor-affinity.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [desktop-linux](<https://devfeed.tech/tags/desktop-linux.md>), [first](<https://devfeed.tech/tags/first.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-benchmarking](<https://devfeed.tech/tags/linux-benchmarking.md>), [linux-hardware-benchmarks](<https://devfeed.tech/tags/linux-hardware-benchmarks.md>), [linux-hardware-reviews](<https://devfeed.tech/tags/linux-hardware-reviews.md>), [linux-how-to](<https://devfeed.tech/tags/linux-how-to.md>), [linux-performance](<https://devfeed.tech/tags/linux-performance.md>), [linux-server-benchmarks](<https://devfeed.tech/tags/linux-server-benchmarks.md>), [nvidia](<https://devfeed.tech/tags/nvidia.md>), [nvidia-vera](<https://devfeed.tech/tags/nvidia-vera.md>), [open-source-graphics](<https://devfeed.tech/tags/open-source-graphics.md>), [performance](<https://devfeed.tech/tags/performance.md>), [phoronix](<https://devfeed.tech/tags/phoronix.md>), [phoronix-test-suite](<https://devfeed.tech/tags/phoronix-test-suite.md>), [smt](<https://devfeed.tech/tags/smt.md>), [threads](<https://devfeed.tech/tags/threads.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>), [ubuntu-24-04](<https://devfeed.tech/tags/ubuntu-24-04.md>), [ubuntu-benchmarks](<https://devfeed.tech/tags/ubuntu-benchmarks.md>), [ubuntu-hardware](<https://devfeed.tech/tags/ubuntu-hardware.md>), [vera-cpu](<https://devfeed.tech/tags/vera-cpu.md>)

### AI overview

The article benchmarks NVIDIA Vera's Spatial Multithreading by comparing CPU performance with SMT enabled and disabled. It describes Vera's two-threads-per-core design, which partitions core hardware resources, and notes that the tests also monitor CPU frequency and power.

### Source excerpt

Recently I was provided remote access to a NVIDIA Vera server with the dual socket Vera CPU Superchip providing 176 Olympus cores plus with NVIDIA's Spatial Multithreading "SMT" implementation providing 352 total threads. With this benchmarking was free rein for testing, including CPU power and frequency monitoring. Over the next few weeks will be a number of articles looking at different areas of NVIDIA Vera performance. One of the areas I was most eager to test was looking at Vera's Spatial Multithreading. Here is a first look at the impact of NVIDIA Vera SMT.

## Releasing Execution Contexts

DevFeed: [Releasing Execution Contexts](<https://devfeed.tech/articles/releasing-execution-contexts-22337.md>)

Original publisher: [Read original article](<https://crystal-lang.org/2026/07/12/releasing-execution-contexts/>)

Author: Julien Portalier

Published: 2026-07-12T00:00:00Z

Content type: release

Language: en

Sources: [Crystal](<https://devfeed.tech/sources/crystal.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Crystal](<https://devfeed.tech/topics/crystal.md>), [execution](<https://devfeed.tech/topics/execution.md>)

Tags: [concurrent](<https://devfeed.tech/tags/concurrent.md>), [context](<https://devfeed.tech/tags/context.md>), [crystal](<https://devfeed.tech/tags/crystal.md>), [fiber](<https://devfeed.tech/tags/fiber.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [parallel](<https://devfeed.tech/tags/parallel.md>)

### AI overview

Execution Contexts let Crystal applications choose how fibers are scheduled across threads, addressing needs such as thread ownership, concurrent fiber groups, and scaling across CPU cores. The default context runs fibers concurrently on one thread (parallelism 1), preserving compatibility; it can be resized to increase parallelism. Applications can also start additional contexts and choose single-threaded, fixed, or adjustable thread limits, with parallelism configurable at runtime. Fibers remain tied to their context. The excerpt defines Concurrent contexts as concurrent but not parallel within that context, while Parallel contexts run fibers concurrently and in parallel; its explanation of the Parallel limit and any other context types is truncated.

### Source excerpt

Two and a half years ago, with the invaluable support from 84codes, we re-examined the multithreading model inherited from Crystal 0.28 (preview MT).

## Using Clojure channels to increase throughput

DevFeed: [Using Clojure channels to increase throughput](<https://devfeed.tech/articles/using-clojure-channels-to-increase-throughput-30521.md>)

Original publisher: [Read original article](<https://medium.com/helpshift-engineering/using-clojure-channels-to-increase-throughput-c051cc7f9893?source=rss----3229f31ca4f4---4>)

Author: Abhinav Dubey

Published: 2025-05-28T10:07:12Z

Content type: article

Language: en

Sources: [Helpshift](<https://devfeed.tech/sources/helpshift.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Apache Kafka](<https://devfeed.tech/topics/apache-kafka.md>), [threadpools](<https://devfeed.tech/topics/threadpools.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>), [LLM evaluation / benchmarking](<https://devfeed.tech/topics/llm-evaluation-benchmarking.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>)

Tags: [channel](<https://devfeed.tech/tags/channel.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [core-async](<https://devfeed.tech/tags/core-async.md>), [grafana](<https://devfeed.tech/tags/grafana.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [kafka-consumer](<https://devfeed.tech/tags/kafka-consumer.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [performance](<https://devfeed.tech/tags/performance.md>), [single-threaded](<https://devfeed.tech/tags/single-threaded.md>), [throughput](<https://devfeed.tech/tags/throughput.md>), [worker](<https://devfeed.tech/tags/worker.md>)

### AI overview

A Clojure Kafka consumer can process messages faster by placing them on a `core.async` channel and having worker threads take and process them; the example uses blocking `>!!` and `<!!` operations and `future`. With 1,000 events, processing time fell from 16m 30s with one worker to 5m 42s with three and 5m with ten. For 2,500 events, it fell from 40m 28s to 13m 39s with three workers and 5m 6s with ten. More workers increased throughput but also raised CPU use and system load, so the article recommends tuning thread count to system capacity. Benchmarks ran on one machine, which the author says is sufficient to gauge the impact of adding workers but may not represent production.

### Source excerpt

When building systems that process large volumes of messages synchronously, performance bottlenecks can quickly become a challenge specially with single-threaded designs. In this post, we'll look at how leveraging worker threads in a Clojure-based Kafka consumer can significantly boost throughput & reduce total processing time. Using simple concurrency primitives, it's possible to achieve parallelism & scale gracefully, all while keeping the codebase clean & maintainable. We'll start with a baseline, introduce worker threads using Clojure's core.async & measure the impact. Setup & Context Kafka & Zookeeper For observability: Grafana Kafka producer: A simple script that sends messages to a Kafka topic at a configurable rate (messages per minute) for a fixed duration. After each event is pushed, a counter metric is emitted Kafka consumer: A simple script that listens to a topic & consumes messages & simulates processing time finding square-root of a number (henceforth, assume that it takes ~1 second to find the square root) . A counter metric is emitted after processing each message The Baseline: Single-Threaded Consumer If each message takes t seconds to process & there are n messages, total processing time becomes n x t seconds. This provides a clean baseline to evaluate the impact of using channel moving forward. Adding workers with core.asyncValues are conveyed on queue-like channels. By default channels require producer and consumer to rendezvous for the transfer of a value through the channel https://clojuredocs.org/clojure.core.async To improve throughput, we introduce parallelism using Clojure's core.async channels. Messages from Kafka are fed into a channel, & multiple worker threads read from this channel to process messages concurrently Here, we used >!! (blocking put) & <!! (blocking take) to communicate via channels & future to execute the business-logic on a separate thread Who gets blocked & when : The thread putting message into the channel will get bl

## Fearless Concurrency Ep.6: Understanding Rust ARC for Efficient Multithreading

DevFeed: [Fearless Concurrency Ep.6: Understanding Rust ARC for Efficient Multithreading](<https://devfeed.tech/articles/fearless-concurrency-ep-6-understanding-rust-arc-for-efficient-multithreading-22270.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/11/fearless-concurrency-ep6-understanding-rust-arc-for-efficient-multithreading.html>)

Published: 2024-11-21T00:00:00Z

Content type: article

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [atomic reference counting](<https://devfeed.tech/topics/atomic-reference-counting.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>)

Tags: [applications](<https://devfeed.tech/tags/applications.md>), [arc](<https://devfeed.tech/tags/arc.md>), [arc-best-practices](<https://devfeed.tech/tags/arc-best-practices.md>), [arc-for-performance](<https://devfeed.tech/tags/arc-for-performance.md>), [arc-in-rust](<https://devfeed.tech/tags/arc-in-rust.md>), [arc-memory-management](<https://devfeed.tech/tags/arc-memory-management.md>), [arc-ownership-model](<https://devfeed.tech/tags/arc-ownership-model.md>), [arc-shared-resources](<https://devfeed.tech/tags/arc-shared-resources.md>), [arc-vs-garbage-collection](<https://devfeed.tech/tags/arc-vs-garbage-collection.md>), [arc-with-mutex](<https://devfeed.tech/tags/arc-with-mutex.md>), [arc-with-rwlock](<https://devfeed.tech/tags/arc-with-rwlock.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [atomic-reference-counting](<https://devfeed.tech/tags/atomic-reference-counting.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrency-in-rust](<https://devfeed.tech/tags/concurrency-in-rust.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [connection-pool](<https://devfeed.tech/tags/connection-pool.md>), [database](<https://devfeed.tech/tags/database.md>), [efficient-multithreading-rust](<https://devfeed.tech/tags/efficient-multithreading-rust.md>), [garbage-collection](<https://devfeed.tech/tags/garbage-collection.md>), [global](<https://devfeed.tech/tags/global.md>), [heap](<https://devfeed.tech/tags/heap.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interior-mutability-arc](<https://devfeed.tech/tags/interior-mutability-arc.md>), [large](<https://devfeed.tech/tags/large.md>), [lightweight](<https://devfeed.tech/tags/lightweight.md>), [lightweight-memory-management](<https://devfeed.tech/tags/lightweight-memory-management.md>), [memory](<https://devfeed.tech/tags/memory.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [multithreading-with-arc](<https://devfeed.tech/tags/multithreading-with-arc.md>), [ownership](<https://devfeed.tech/tags/ownership.md>), [rust](<https://devfeed.tech/tags/rust.md>), [rust-arc-tutorial](<https://devfeed.tech/tags/rust-arc-tutorial.md>), [rust-arc-use-cases](<https://devfeed.tech/tags/rust-arc-use-cases.md>), [rust-concurrency-tools](<https://devfeed.tech/tags/rust-concurrency-tools.md>), [rust-shared-ownership](<https://devfeed.tech/tags/rust-shared-ownership.md>), [rust-thread-safe-programming](<https://devfeed.tech/tags/rust-thread-safe-programming.md>), [thread-safe-data-sharing](<https://devfeed.tech/tags/thread-safe-data-sharing.md>)

### AI overview

Rust ARC shares a heap-allocated value across threads by cloning a pointer and incrementing its reference count; dropping each pointer decrements the count, and the value is destroyed when the count reaches zero. This avoids copying the underlying data and can suit high fan-out sharing, such as sharing configuration or a database connection pool. The excerpt also mentions combining ARC with interior mutability for thread-safe updates and flags circular references as a pitfall. It presents ARC as shared ownership without a traditional garbage collector; the excerpt does not identify the interior-mutability types or give their usage details.

### Source excerpt

Introduction: Welcome to Episode 6 of the Fearless Concurrency in Rust series! In this episode, we explore the powerful concept of ARC (Atomic Reference Counting) and its critical role in managing shared resources in multithreaded Rust programs. By leveraging ARC, developers can safely share ownership of data across threads without relying on a traditional garbage collector, enabling efficient, flexible, and scalable concurrency. What is ARC?: Understanding Atomic Reference Counting as a lightweight, manual garbage collection system.

## Fearless Concurrency Ep.1: Rust's Approach to Safe and Manageable Multithreading

DevFeed: [Fearless Concurrency Ep.1: Rust's Approach to Safe and Manageable Multithreading](<https://devfeed.tech/articles/fearless-concurrency-ep-1-rust-s-approach-to-safe-and-manageable-multithreading-22258.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/09/fearless-concurrency-ep1-rusts-approach-to-safe-and-manageable-multithreading.html>)

Published: 2024-09-12T00:00:00Z

Content type: article

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [synchronization](<https://devfeed.tech/topics/synchronization.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [c/c++](<https://devfeed.tech/topics/c-c-plus-plus.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>)

Tags: [basics](<https://devfeed.tech/tags/basics.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [challenge](<https://devfeed.tech/tags/challenge.md>), [challenges](<https://devfeed.tech/tags/challenges.md>), [compile-time-safety-in-rust](<https://devfeed.tech/tags/compile-time-safety-in-rust.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrency-in-rust](<https://devfeed.tech/tags/concurrency-in-rust.md>), [concurrency-pitfalls-in-c-plus-plus](<https://devfeed.tech/tags/concurrency-pitfalls-in-c-plus-plus.md>), [concurrently](<https://devfeed.tech/tags/concurrently.md>), [context](<https://devfeed.tech/tags/context.md>), [efficient-threading-in-rust](<https://devfeed.tech/tags/efficient-threading-in-rust.md>), [go](<https://devfeed.tech/tags/go.md>), [go-vs-rust-concurrency](<https://devfeed.tech/tags/go-vs-rust-concurrency.md>), [herbert-wolverson-fearless-concurrency](<https://devfeed.tech/tags/herbert-wolverson-fearless-concurrency.md>), [history](<https://devfeed.tech/tags/history.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [managing-threads-in-rust](<https://devfeed.tech/tags/managing-threads-in-rust.md>), [memory-safety-in-rust](<https://devfeed.tech/tags/memory-safety-in-rust.md>), [model](<https://devfeed.tech/tags/model.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [mutexes-and-locks-in-rust](<https://devfeed.tech/tags/mutexes-and-locks-in-rust.md>), [operating-systems](<https://devfeed.tech/tags/operating-systems.md>), [preventing-data-races-in-rust](<https://devfeed.tech/tags/preventing-data-races-in-rust.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-conditions-in-rust](<https://devfeed.tech/tags/race-conditions-in-rust.md>), [rust](<https://devfeed.tech/tags/rust.md>), [rust-concurrency-tools](<https://devfeed.tech/tags/rust-concurrency-tools.md>), [rust-memory-management](<https://devfeed.tech/tags/rust-memory-management.md>), [rust-multithreading](<https://devfeed.tech/tags/rust-multithreading.md>), [rust-ownership-system](<https://devfeed.tech/tags/rust-ownership-system.md>), [rust-programming-threads](<https://devfeed.tech/tags/rust-programming-threads.md>), [rust-thread-management-tips](<https://devfeed.tech/tags/rust-thread-management-tips.md>), [rust-thread-safety](<https://devfeed.tech/tags/rust-thread-safety.md>), [rust-vs-c-plus-plus-multithreading](<https://devfeed.tech/tags/rust-vs-c-plus-plus-multithreading.md>), [safe-concurrency-in-rust](<https://devfeed.tech/tags/safe-concurrency-in-rust.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threading](<https://devfeed.tech/tags/threading.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

Rust uses OS-native threads with little additional overhead, but shared data still requires careful coordination. The excerpt describes common multithreading hazards such as race conditions and garbled output, and explains that Rust's ownership and borrowing rules prevent unsynchronized concurrent mutation. Mutexes and locks provide explicit coordination when threads need access to shared data; Rust's type system checks safety constraints at compile time. The discussion contrasts threads with older, resource-intensive process forking and mentions C++ and Go examples of concurrency problems, but gives no detailed comparative feature analysis.

### Source excerpt

Introduction: In Episode 1 of the Fearless Concurrency in Rust series, Herbert Wolverson introduces the foundational concept of threads in programming, tracing their origins and evolution while demonstrating how Rust handles concurrency in a safer, more manageable way. He explores the history of threads and their role in enabling programs to perform multiple tasks simultaneously, comparing Rust's threading model with traditional approaches in C++ and Go. Thread Basics and History: Understanding how threads function within operating systems and their development over time.

## Concurrent Programming in Kotlin: Ensuring Thread Safety with Mutex

DevFeed: [Concurrent Programming in Kotlin: Ensuring Thread Safety with Mutex](<https://devfeed.tech/articles/concurrent-programming-in-kotlin-ensuring-thread-safety-with-mutex-23873.md>)

Original publisher: [Read original article](<https://engineering.premise.com/concurrent-programming-in-kotlin-ensuring-thread-safety-with-mutex-5d9c6b80644b?source=rss----c5fada0a103d---4>)

Author: Kwabena Bio Berko

Published: 2023-07-18T03:33:24Z

Content type: article

Language: en

Sources: [Engineering at Premise](<https://devfeed.tech/sources/engineering-at-premise-medium.md>)

Topics: [locking](<https://devfeed.tech/topics/locking.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [shared mutable state](<https://devfeed.tech/topics/shared-mutable-state.md>), [synchronization](<https://devfeed.tech/topics/synchronization.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [suspend function](<https://devfeed.tech/topics/suspend-function.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-engineer](<https://devfeed.tech/tags/android-engineer.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [component](<https://devfeed.tech/tags/component.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [concurrent-programming](<https://devfeed.tech/tags/concurrent-programming.md>), [concurrently](<https://devfeed.tech/tags/concurrently.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [data](<https://devfeed.tech/tags/data.md>), [database](<https://devfeed.tech/tags/database.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [safety](<https://devfeed.tech/tags/safety.md>), [software](<https://devfeed.tech/tags/software.md>), [thread](<https://devfeed.tech/tags/thread.md>), [thread-safety](<https://devfeed.tech/tags/thread-safety.md>)

### AI overview

The article describes using Kotlin's Mutex to prevent concurrent refresh calls from duplicating a remote fetch and database write. It presents two behaviors: a call can check whether the Mutex is locked and skip refresh while it is in use, or use the suspending `withLock` lambda to wait until the lock is released. Restricting access to critical sections helps prevent race conditions and keep shared data consistent, but locking too much code can serialize work, reduce parallelism, and slow the application. The article recommends limiting Mutex use to sections that require exclusive access.

### Source excerpt

By Kwabena Bio Berko, Android Engineer Photo by Chris Ried on Unsplash I have recently been experimenting with mutual exclusion(Mutex), a concept in software engineering to solve race conditions when accessing shared resources. Let's assume we have a component with a refresh function that can be accessed from multiple threads or coroutines: https://medium.com/media/e19aa2a9d57bc105b841d28061a199b8/href In the implementation of this component, the function retrieves data from a remote resource and inserts it into the local database. However, these operations need to be atomic. Now, imagine if 10 threads call this function simultaneously, or even a few milliseconds apart. What happens? If you guessed that we make 10 network calls and 10 database IO operations to save the items, then you would be right, as confirmed by the below test: https://medium.com/media/9b279658dbf87021068ee21a913dc80e/hrefhttps://medium.com/media/81cdc164ad807fd45df77389c00bd4cc/href But that's not what we want. It's definitely not resource-friendly. To address this issue, we can use a Mutex. As the name suggests, a Mutex provides mutual exclusion for a specific portion of your code, imposing restrictions on the access to that portion in situations where multiple threads or coroutines may attempt to access it concurrently. In essence, Mutex allows only one thread or coroutine to work within the confines of that portion of the code at any given time. By introducing a Mutex in our refresh function, we can ensure that only one thread is executing the critical sections of the code, preventing race conditions and ensuring atomicity of the operations. https://medium.com/media/9d88a802b4c73f14ceb4d5527158af5d/href In the example above, whenever the refresh function is called, we check to see if the Mutex is already locked or been used. If not, we lock it and then perform our network call and save the results in our local database. This means that whenever another thread or coroutine calls this refresh

## PSA: Thread-local state is no longer recommended

DevFeed: [PSA: Thread-local state is no longer recommended](<https://devfeed.tech/articles/psa-thread-local-state-is-no-longer-recommended-46339.md>)

Original publisher: [Read original article](<https://julialang.org/blog/2023/07/PSA-dont-use-threadid/index.html>)

Author: Mason Protter; Valentin Churavy; Ian Butterworth; and many helpful contributors

Published: 2023-07-06T00:00:00Z

Content type: article

Language: en

Sources: [JuliaLang - The Julia programming language](<https://devfeed.tech/sources/julialang-the-julia-programming-language.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [The Julia Language](<https://devfeed.tech/topics/julia.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrency-bugs](<https://devfeed.tech/tags/concurrency-bugs.md>), [deadlock](<https://devfeed.tech/tags/deadlock.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [thread](<https://devfeed.tech/tags/thread.md>)

### AI overview

A Julia blog post warns that relying on thread-local state and threadid() can produce race conditions because tasks may yield and migrate between tasks on the same thread. It recommends safer task-based patterns for managing and returning state.

### Source excerpt

PSA: Thread-local state is no longer recommended; Common misconceptions about threadid() and nthreads()

## Julia 1.7 Highlights

DevFeed: [Julia 1.7 Highlights](<https://devfeed.tech/articles/julia-1-7-highlights-46332.md>)

Original publisher: [Read original article](<https://julialang.org/blog/2021/11/julia-1.7-highlights/index.html>)

Author: Jeff Bezanson; Jameson Nash; Ian Butterworth; Kristoffer Carlsson; Shuhei Kadowaki; Elliot Saba; Viral B Shah; Mosè Giordano; Simeon Schaub; Nicholas Bauer

Published: 2021-11-30T00:00:00Z

Content type: release

Language: en

Sources: [JuliaLang - The Julia programming language](<https://devfeed.tech/sources/julialang-the-julia-programming-language.md>)

Topics: [The Julia Language](<https://devfeed.tech/topics/julia.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [releases](<https://devfeed.tech/topics/releases.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Randomizer](<https://devfeed.tech/topics/randomizer.md>), [synchronization](<https://devfeed.tech/topics/synchronization.md>), [reproducibility](<https://devfeed.tech/topics/reproducibility.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>)

Tags: [atomic](<https://devfeed.tech/tags/atomic.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [release](<https://devfeed.tech/tags/release.md>), [releases](<https://devfeed.tech/tags/releases.md>), [reproducibility](<https://devfeed.tech/tags/reproducibility.md>), [scheduling](<https://devfeed.tech/tags/scheduling.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

Julia 1.7 is presented as a release overview, highlighting changes for multithreaded programs. The release introduces task-based random-number state for reproducible results, addresses runtime race conditions and synchronization issues, improves workload scheduling, and adds atomic access to mutable struct fields.

### Source excerpt

Some highlights of the Julia 1.7 release.

## Anonymous CompletableFuture threads with burstable pods

DevFeed: [Anonymous CompletableFuture threads with burstable pods](<https://devfeed.tech/articles/anonymous-completablefuture-threads-with-burstable-pods-26081.md>)

Original publisher: [Read original article](<https://blog.arkey.fr/2020/12/11/completablefuture-with-burstable-pods/>)

Author: brice.dutheil@gmail.com (Brice Dutheil)

Published: 2020-12-11T13:05:00Z

Content type: article

Language: en

Sources: [The Coffee Workshop](<https://devfeed.tech/sources/the-coffee-workshop.md>)

Topics: [threadpools](<https://devfeed.tech/topics/threadpools.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>)

Tags: [completablefuture](<https://devfeed.tech/tags/completablefuture.md>), [container](<https://devfeed.tech/tags/container.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

A JFR recording showed many short-lived anonymous threads, whose allocation events helped trace them to CompletableFuture tasks using the default ForkJoinPool. The excerpt says that when the JVM sees no more than one processor, the pool may create a new thread for each task; a Kubernetes CPU setting of two is mentioned, but the excerpt does not establish what processor count the JVM saw in that case. It identifies two possible fixes: pass an executor to the code or configure the default pool's parallelism. The text ends before detailing the configuration method.

### Source excerpt

It all started when opening a JFR recording, I noticed a very large and growing number of very short lived threads.

## Fastest way to profile a method in Ruby

DevFeed: [Fastest way to profile a method in Ruby](<https://devfeed.tech/articles/fastest-way-to-profile-a-method-in-ruby-41342.md>)

Original publisher: [Read original article](<https://samsaffron.com/archive/2017/10/18/fastest-way-to-profile-a-method-in-ruby>)

Author: Sam Saffron

Published: 2017-10-18T00:21:47Z

Content type: tutorial

Language: en

Sources: [Sam Saffron](<https://devfeed.tech/sources/sam-saffron.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Instrumentation](<https://devfeed.tech/topics/instrumentation.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Process](<https://devfeed.tech/topics/process.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [instrumentation](<https://devfeed.tech/tags/instrumentation.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [profile](<https://devfeed.tech/tags/profile.md>), [redis](<https://devfeed.tech/tags/redis.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

This Ruby tutorial compares methods for measuring elapsed time and patching methods for instrumentation. It finds that Process.clock_gettime with CLOCK_MONOTONIC is faster and more accurate than using Time.now in the presented benchmarks, and discusses alternatives for instrumenting code without source-level changes.

### Source excerpt

Lately I needed to add some instruments into Discourse. I wanted every request to measure: How many SQL statements and Redis commands are executed? How much time was spent in those sections? This can easily be abstracted to a more generalized problem of class ExternalClass def method_to_measure end end Solving this problem breaks down into a few particular sub-problems What is the fastest way of measuring elapsed time in a method? What is the fastest patch to a method that can add instrumentation? How does one account for multithreading? Fastest way to measure a method The first and simplest problem to solve is pretending we do not have to patch anything. If we had access to all the source and could add all the instruments we wanted to, what is the quickest way of measuring elapsed time? There are two techniques we can use in Ruby. Create a Time object before and after and delta. Use Process.clock_gettime to return a Float before and after and delta. Let's measure: require 'benchmark/ips' class Test attr_reader :count, :duration def initialize @count = 0 @duration = 0.0 end def work end def method work end def time_method @count += 1 t = Time.now work ensure @duration += Time.now - t end def process_clock_get_time_method @count += 1 t = Process.clock_gettime(Process::CLOCK_MONOTONIC) work ensure @duration += Process.clock_gettime(Process::CLOCK_MONOTONIC) - t end end t = Test.new Benchmark.ips do |b| b.report "method" do |times| i = 0 while i < times t.method i += 1 end end b.report "time_method" do |times| i = 0 while i < times t.time_method i += 1 end end b.report "process_clock_get_time_method" do |times| i = 0 while i < times t.process_clock_get_time_method i += 1 end end end # Calculating ------------------------------------- # method 19.623M (± 3.5%) i/s - 98.227M in 5.012204s # time_method 1.596M (± 1.2%) i/s - 8.061M in 5.050321s # process_clock_get_time_method # 4.972M (± 1.7%) i/s - 24.908M in 5.011634s As expected Process.clock_gettime(Process::CLOCK_MONO

## Make Your Program Slower With Threads

DevFeed: [Make Your Program Slower With Threads](<https://devfeed.tech/articles/make-your-program-slower-with-threads-12468.md>)

Original publisher: [Read original article](<http://brooker.co.za/blog/2014/12/06/random.html>)

Author: Marc Brooker

Published: 2014-12-06T00:00:00Z

Content type: article

Language: en

Sources: [Marc Brooker's](<https://devfeed.tech/sources/marc-brooker-s-blog.md>)

Topics: [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [synchronization](<https://devfeed.tech/topics/synchronization.md>), [locking](<https://devfeed.tech/topics/locking.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>)

Tags: [1c](<https://devfeed.tech/tags/1c.md>), [amdahl-s-law](<https://devfeed.tech/tags/amdahl-s-law.md>), [birthday](<https://devfeed.tech/tags/birthday.md>), [faster](<https://devfeed.tech/tags/faster.md>), [generator](<https://devfeed.tech/tags/generator.md>), [less](<https://devfeed.tech/tags/less.md>), [like](<https://devfeed.tech/tags/like.md>), [linux](<https://devfeed.tech/tags/linux.md>), [numerical-methods](<https://devfeed.tech/tags/numerical-methods.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [perf](<https://devfeed.tech/tags/perf.md>), [performance](<https://devfeed.tech/tags/performance.md>), [random](<https://devfeed.tech/tags/random.md>), [single-threaded](<https://devfeed.tech/tags/single-threaded.md>), [stat](<https://devfeed.tech/tags/stat.md>), [statistics](<https://devfeed.tech/tags/statistics.md>), [switches](<https://devfeed.tech/tags/switches.md>), [threads](<https://devfeed.tech/tags/threads.md>), [time](<https://devfeed.tech/tags/time.md>), [tool](<https://devfeed.tech/tags/tool.md>)

### AI overview

In this birthday-simulation benchmark, adding threads made the program much slower because each thread called `random(3)`, whose glibc implementation locks shared state. On a four-core Haswell E3-1240, one thread completed 10 million attempts in under 7 seconds and two threads took under 6 seconds, while the four-thread profile showed about 16 million context switches, 46.8% of sampled overhead in `_raw_spin_lock`, and roughly 47 million futex calls. Replacing `random` with the reentrant `random_r` reduced context switches to 572 and restored L1 cache misses and instructions per cycle close to the one-thread figures. The example is described as contrived, but illustrates how synchronized library or system calls in tight loops can make multithreaded code slower than its single-threaded equivalent.

### Source excerpt

Make Your Program Slower With Threads How much do context switches matter? Years ago, while taking a numerical methods course, I wrote some code to calculate the expected number of shared birthdays in a group. The code is very simple: each attempt constructs a vector of N birthdays, then counts the duplicates. The outer loop runs millions of attempts, and calculates the mean number of shared birthdays across all the samples. It's little more than a tight loop around a pseudo-random number generator. I was also learning about threading at the time, and decided that I could speed up my program by running it on the lab's shiny dual-core machine. I knew that communicating between threads was expensive, so I had each of my threads calculate their attempts in parallel, and merge the results right at the end. I was expecting a great speedup. Much to my disappointment, though, the multi-threaded version was slower. Much, much, slower. Much like the birthday paradox runs counter to our intuition about statistics, the behavior of bad multi-threaded programs runs counter to our intuition about computer performance. We're used to computers being much faster than they used to be, and single-threaded efficiency mattering less than it used to in most cases. Counter to that intuition, the gap between good and bad multithreaded programs has gotten worse over time. To illustrate just how bad it can be, I replicated my program from back then. It's not much more than a multi-threaded tight loop around random(3). It's nice and quick single-threaded: running 10 million attempts in under 7 seconds. Going up to two threads makes it a bit faster, down to less than 6 seconds. When we hit three threads (on my four core Haswell E3-1240), it all goes horribly wrong: To figure out what's wrong, we can turn to Linux's excellent perf tool. Running the 1-thread and 4-thread versions with perf stat make it obvious that something's going on. For 1 thread: 3,788,352 L1-dcache-load-misses #0.03% of all

## Building the new SoundCloud iOS application -- Part I: The reactive paradigm

DevFeed: [Building the new SoundCloud iOS application -- Part I: The reactive paradigm](<https://devfeed.tech/articles/building-the-new-soundcloud-ios-application-part-i-the-reactive-paradigm-2005.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//building-the-new-ios-app-a-new-paradigm>)

Published: 2014-07-07T00:00:00Z

Content type: article

Language: en

Sources: [SoundCloud Backstage](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [reactive](<https://devfeed.tech/topics/reactive.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [state-management](<https://devfeed.tech/topics/state-management.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [core-data](<https://devfeed.tech/tags/core-data.md>), [created](<https://devfeed.tech/tags/created.md>), [debug](<https://devfeed.tech/tags/debug.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [ios](<https://devfeed.tech/tags/ios.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [reactive](<https://devfeed.tech/tags/reactive.md>)

### AI overview

SoundCloud's iOS rewrite used Reactive Cocoa signals to compose an API request, JSON parsing, and mapping into Core Data objects. Each step returns a signal, and `flattenMap:` passes results along while allowing failures to propagate. RAC schedulers run network and parsing work in the background, Core Data adaptation on its required private queue, and UI updates on the main thread. The article says this approach simplified composition, concurrency, and error handling, but brought a steep learning curve, nested and sometimes verbose code, retain-cycle and disposable management, and overhead that can make RAC unsuitable for performance-critical work such as fast UI rendering. The team recommends clear boundaries for reactive code; it also describes focused components and custom `expecta` matchers as aids to testing.

### Source excerpt

Recently, SoundCloud launched the new iOS application which was a complete rewrite of the existing iOS application. The Mobile engineering...