Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Aren't they connected by the idea of active objects? https://en.wikipedia.org/wiki/Active_object


Based on the description in your Wikipedia link there is a relationship for sure -- but I don't see a strong connection. Here's how I see it:

An Active Object is essentially an OO encapsulation of a worker thread. It provides clients with a synchronous call interface where all results are resolved asynchronously (e.g. using futures for results). Internally, the Active Object converts client requests into asynchronous operations, enqueues the operations, and executes them on a private worker thread using object-specific dispatcher logic.

In an OO system, not all objects are required to be Active Objects. So there may be a mixture of synchronous and asynchronous execution.

In contrast, in an Actor system all communication is via asynchronous messages and there is no inherent requirement for multiple concurrent threads of execution.

Active Objects use a mechanism such as futures to return results. On the other hand, if there is a request-reply message exchange in an Actor system, both the request and the reply will be separate messages. The client would receive the result of a computation by receiving a message.

The relationship I see between Actors and Active Objects is that both require some kind of queue for dispatching operations (since Actor behaviors are never re-entrant). Active Objects convert synchronous calls into asynchronous operation requests, whereas Actors use asynchronous messages for _all_ inter-entity communication.

I agree with the GP that event loop programming is the closer OO analogue of Actors.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: