hn.today

An OS with no threads: The Actor Model

timdbg.com335 points149 comments
Screenshot of An OS with no threads: The Actor Model

DbgOS is a Rust operating system built to explore unconventional design choices, and its concurrency model treats everything as an actor. Each actor owns its state, receives messages through a mailbox, and communicates with other actors only by sending messages. Modules describe actors and serializable data types in generated metadata, allowing the system to identify and migrate types across versions. Actors run initialization once, then respond to messages; reply slots connect requests to responses, while Rust futures provide async-style workflows for operations such as network retries.

The design prohibits writable memory segments in modules, blocking calls, simultaneous handling by one actor, and handlers that run beyond a short time limit. These constraints eliminate shared writable state, locks, re-entrancy, and ordinary preemption. The tradeoff is cooperative execution: CPU-heavy work must be divided into resumable chunks, though futures can make this manageable. The approach also avoids the stacks and saved register contexts required by conventional threads, which can consume tens of kilobytes per idle thread and become costly at large scale. Compared with green threads and async I/O, actors offer low idle memory use and strong isolation, at the cost of structuring computation to yield explicitly. The central case is that message passing makes components easier to reason about independently while reducing concurrency hazards and resource overhead.

Read on timdbg.com149 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.