# DbgOS experiment replaces operating-system threads with actors

An experimental operating system written in Rust is exploring whether the actor model can replace conventional threads, locks and shared writable state at the foundation of an operating system. The developer of DbgOS described the design on the project's technical blog on the event date.

The actor model organizes concurrent software as independent components that communicate by sending messages. Each actor keeps its own state and mailbox rather than allowing other components to modify its data directly. The approach dates to a 1973 paper by Carl Hewitt, Peter Bishop and Richard Steiger and is widely associated with actor-style systems such as Erlang. DbgOS applies the concept broadly: keyboards, windows, applications, network devices and services can each be represented as actors connected through message flows.

In the current design, DbgOS modules are ELF binaries containing metadata for their data types and actors. Rust macros generate that metadata, including schemas that allow values to be serialized, deserialized and migrated between versions. An actor definition specifies the arguments used to create it, the messages it accepts and the type of its internal state.

Actors begin with an initialization function and then execute only when handling messages. A context interface lets them locate other actors, send messages, create new instances and set timers. For request-and-response work, a reply-slot mechanism connects a response to the request that initiated it. The system can combine that mechanism with Rust futures, allowing developers to write asynchronous code while the compiler constructs the underlying state machine.

The operating system imposes an important constraint: every message handler must finish within a bounded time. Because handlers are not paused and resumed as conventional threads, DbgOS does not need to preserve their execution contexts, and re-entrant access to an actor's writable state is prevented by the design. Separate tasks operate in isolated contexts and can communicate results only through messages.

That simplicity shifts work onto developers when a computation would otherwise monopolize a processor. CPU-intensive operations must be divided into chunks that can pause and resume cooperatively. The developer identified decompression, image loading and checksum calculation as current examples. Hardware interrupts still pre-empt execution briefly, but their small kernel handlers return to the interrupted code rather than scheduling a different actor instance.

DbgOS is a research and learning project, not evidence that the architecture is ready to replace mature production operating systems. Its significance is the concrete systems experiment: using compiler checks, data isolation and message passing to remove broad categories of shared-state concurrency problems while accepting explicit tradeoffs in scheduling and long-running computation.