IT lexicon › Programming › Active object

Active object

Programming På svenska → Updated: 2026-11-04

An object that owns its own thread and its own event queue, so the outside world can only post messages to it — never touch its data directly.

R. Greg Lavender and Douglas Schmidt wrote the pattern down in 1996, but the idea was already present in ROOM, Bran Selic's method for real-time telecom systems. Each active object has a private queue, takes one event at a time and runs it to completion before looking at the next. Since nobody else can reach its state, there are no mutexes to get wrong, and the usual garden of RTOS bugs — priority inversion, deadlock, the forgotten semaphore — has nowhere to grow.

In embedded work the pattern is best known through Miro Samek's QP framework: active objects driven by hierarchical state machines, on top of a tiny kernel or an existing RTOS. The cost is that everything becomes asynchronous. Want an answer? Wait for another event. A blocking delay() in the middle of a handler is precisely what the pattern exists to outlaw.

← Back to the lexicon