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.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.