TL;DR

Restartable sequences (rseq) are a Linux feature allowing lockless, thread-safe data structures on multi-core systems. Currently used in some libraries, rseq offers significant performance improvements, especially on high-core-count CPUs. Its adoption could reshape system programming.

Restartable sequences (rseq), a Linux system programming feature introduced around 2018, are gaining attention for their ability to enable lockless, thread-safe data structures that scale efficiently across many CPU cores.

Rseq allows user-space programs to define small sequences of assembly instructions that the kernel can abort and retry if a thread is preempted or migrated to a different CPU. Currently, rseq is only accessible through handwritten assembly code, but it is used in libraries like tcmalloc, jemalloc, glibc, and cosmopolitan. Developers report that on high-core-count systems, rseq can improve malloc() performance by up to 43 times compared to traditional sharding techniques.

For example, on a $160 Raspberry Pi 5 with four cores, rseq speeds up malloc() by 3x. On a $4,834 System76 Thelio Astra with 128 cores, it yields a 34x speedup, and on a $17,628 AMD Threadripper with 96 cores, a 43x improvement has been observed. These enhancements are particularly relevant as microprocessors with 128 or more cores become more affordable and widespread.

Why It Matters

Rseq’s ability to facilitate lockless, scalable data structures directly addresses performance bottlenecks in high-core-count systems. As hardware continues to evolve toward many-core architectures, adopting rseq could lead to substantial efficiency gains in system and application performance, impacting fields from AI to high-performance computing.

The Linux Programming Interface: A Linux and UNIX System Programming Handbook

The Linux Programming Interface: A Linux and UNIX System Programming Handbook

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Introduced in Linux 4.18, rseq has been a niche feature mainly used in specialized libraries. Its potential for widespread adoption is increasing as the industry shifts toward multi-core processors with dozens or hundreds of cores. Currently, support for rseq requires manual assembly programming, but there is a strong expectation that future operating systems and languages will integrate native support, enabling broader use.

“Restartable sequences are poised to transform system programming, especially on high-core-count CPUs, by enabling lockless data structures that scale efficiently.”

— Justine, developer and researcher

“The adoption of rseq could be a game-changer for high-performance computing and AI workloads, where minimizing synchronization overhead is critical.”

— Industry analyst

High Performance Computing: Modern Systems and Practices

High Performance Computing: Modern Systems and Practices

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It remains unclear when widespread support for rseq will be integrated into mainstream operating systems and programming languages. Currently, implementation requires handwritten assembly, limiting accessibility. The pace of adoption and the development of higher-level abstractions are still evolving.

Thermal Grizzly Delid-Die-Mate - Intel 13th Gen CPU Delid Tool - CPU Heatspreader Removing Tool - Made in Germany

Thermal Grizzly Delid-Die-Mate – Intel 13th Gen CPU Delid Tool – CPU Heatspreader Removing Tool – Made in Germany

DER8AUER DELIDDING TOOL – Compatible with 12th/13th Intel Core generation, developed by Roman "der8auer" Hartung

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Future developments may include official kernel support for rseq, integration into system libraries, and language-level abstractions. Developers and system programmers should monitor updates in Linux kernel versions and language compilers for potential support, and experiment with rseq in high-performance applications.

Amazon

lockless data structure libraries

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What are restartable sequences (rseq)?

Rseq is a Linux feature that allows user-space programs to define small sequences of assembly instructions that the kernel can abort and retry if a thread is preempted or migrated, enabling lockless, scalable data structures.

Why is rseq important for high-core-count CPUs?

Rseq reduces synchronization overhead by enabling lockless data access, which is crucial for maintaining performance as the number of CPU cores increases significantly.

Is rseq supported across all operating systems?

No, currently rseq is primarily available on Linux and requires manual assembly programming. Future OS support is anticipated but not yet confirmed.

How does rseq improve malloc() performance?

Rseq allows malloc implementations to avoid locking or sharding across cores, dramatically reducing contention and increasing speed, especially on systems with many cores.

Source: Hacker News

You May Also Like

Kill-Switch-Proof: How to Build So Washington Can’t Take Your AI Stack Down

Learn the strategies to make AI stacks kill-switch-proof amid government shutdowns and export restrictions, based on recent developments in June 2026.

How To Calculate The Total Cost Of Sovereign AI Deployment

A detailed analysis of the costs involved in self-hosting sovereign AI models versus buying from vendors, highlighting key financial factors and uncertainties.

The Kill Switch: What the Anthropic Export Ban Really Costs the AI Industry

Anthropic’s models were shut down by U.S. authorities, raising concerns over industry stability, security, and future AI deployment strategies.

Aleph Alpha. The retrospective case.

Analyzing Aleph Alpha’s strategic pivot, funding, and acquisition, highlighting the risks of late structural lessons in European sovereign AI development.