concept actor in category c#

appears as: ctors, ctor, actor, n actor
Functional Programming in C#: How to write better C# code

This is an excerpt from Manning's book Functional Programming in C#: How to write better C# code.

For these reasons, I’ll concentrate on message-passing concurrency in the rest of this chapter, and especially agent-based concurrency. You’ll later see how agents and actors differ in more detail. Let’s begin by looking at message-passing concurrency as a programming model.

15.2.4. Agents vs. actors

Agents and actors are closely related. In both cases, a single thread processes messages sequentially and communicates with other actors/agents by sending them messages. There are also important differences:

  • Agents run within a single process, whereas actors are designed for distributed systems. In the examples we’ve looked at so far, a reference to an agent refers to a specific instance in the current process. References to actors, on the other hand, are location-transparent; that is, when you have a reference to an actor, that actor may be running in the same process or on another process, possibly on a remote machine. So a reference to an agent is a pointer, whereas a reference to an actor is an ID that the actor model implementation will use to route messages across processes as appropriate.