Active Objects, sometimes called Actors, are event-driven objects running in their own threads of control that handles requests from the other components of the solution using a message queue.

Ideally, the only thread allowed to read, or modify, the data that belongs to an active object, is the execution thread of the active object, maximizing CPU utilization.

The message queue of an active object us typically a multi producer, single consumer (MPSC) blocking queue. A blocking queue stops the execution of the consumer thread when the queue is empty, preventing the consumer thread from consuming CPU time when there is no work to be done.

An unbounded MPSC blocking queue will accept an unlimited amount of in-flight messages, which may be beneficial if the active object receives burst of input messages, scaling back the memory requirements for the queue when the consumer catches up with its workload. On the other hand, if the producers posts more messages to the message queue than the consumer is able to process, the queue will grow until the system runs out of memory. This can be prevented by using a bounded MPSC blocking queue. A bounded blocking queue has a hard limit on the number of in-flight messages it can handle, and blocks the execution of the producer threads when the queue is full.

In C++ an active object will typically provide a public API that composes messages from the function arguments that are posted on the message queue, hiding this piece of complexity from the rest of the application. If the call is a request for information from the active object, the api will typically return a std::future object, or some other object that can be waited on until the active object has processed the request.