Questions tagged [actor]

Programming model distinguished by ubiquitous asynchronous communication.

The "actor" programming model is a specific variant of object-oriented programming that incorporates a particular model of concurrency. Carl Hewitt is perhaps the person most responsible for articulating this model, though others can certainly take credit for refining the ideas.

In its purest form, in the actor model, every actor (that is, every object) encapsulates a piece of state, a thread of control, and a "mailbox" for receiving messages. The only way to get an actor to do anything is to send a message to its mailbox, asynchronously. Each actor independently services its mailbox, responding to messages (including by updating its state, sending other messages to other actors, and creating new actors) as it sees fit.

One example of a mature language that embraces the actor model is . There are of course others.

Useful links:

Related tags:

- The Coyote open source asynchronous programming framework

2055 questions
214
votes
5 answers

How does LMAX's disruptor pattern work?

I am trying to understand the disruptor pattern. I have watched the InfoQ video and tried to read their paper. I understand there is a ring buffer involved, that it is initialized as an extremely large array to take advantage of cache locality,…
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
115
votes
3 answers

When to use actors instead of messaging solutions such as WebSphere MQ or Tibco Rendezvous?

I've already read the question and answers to What design decisions would favour Scala's Actors instead of JMS?. Usually, we use messaging solutions which have existed for years already: either a JMS implementation such as WebSphere MQ or Apache…
Kai Wähner
  • 1,201
  • 2
  • 10
  • 7
110
votes
5 answers

Scala actors: receive vs react

Let me first say that I have quite a lot of Java experience, but have only recently become interested in functional languages. Recently I've started looking at Scala, which seems like a very nice language. However, I've been reading about Scala's…
jqno
  • 15,133
  • 7
  • 57
  • 84
101
votes
3 answers

How is Node.js evented system different than the actor pattern of Akka?

I've worked with Node.js for a little while and consider myself pretty good with Java. But I just discovered Akka and was immediately interested in its actor pattern (from what I understand). Now, assuming my JavaScript skills were on par with my…
cbmeeks
  • 11,248
  • 22
  • 85
  • 136
92
votes
2 answers

How does Actors work compared to threads?

Is there any good and short explanation of how Actors works compared to threads? Can't a thread be seen as an actor and send messages to other threads? I see some difference, but it's not that clear for me. Can I use Actors in any language by using…
Jonas
  • 121,568
  • 97
  • 310
  • 388
83
votes
1 answer

What design decisions would favour Scala's Actors instead of JMS?

What are the differences using Scala Actors instead of JMS? For example from a performance and scalability perspective, what does the Scala Actor model add compared to JMS? In which cases does it make more sense to use Actors rather than JMS, i.e.…
Kristian
  • 6,443
  • 6
  • 27
  • 29
82
votes
2 answers

Akka in Scala, exclamation mark and question mark

What is the difference between exclamation mark (!) and question mark (?) when sending messages to Actors? myActor ! Hello(value1) myActor ? Hello(value1)
ticofab
  • 7,551
  • 13
  • 49
  • 90
79
votes
6 answers

The actor model: Why is Erlang/OTP special? Could you use another language?

I've been looking into learning Erlang/OTP, and as a result, have been reading (okay, skimming) about the actor model. From what I understand, the actor model is simply a set of functions (run within lightweight threads called "processes" in…
Jonathan Winks
  • 1,091
  • 2
  • 9
  • 12
78
votes
3 answers

What's the difference of the Akka's Actor with Scala's Actor model

I found there is also an Akka actor model, so I am wondering what's the difference between the Akka's Actor and Scala's Actor model?
Evans Y.
  • 4,209
  • 6
  • 35
  • 43
78
votes
13 answers

Any good implementation of Actors for C#?

Is there any good implementation of actors concurrency model for .net/c#? I have to optimize a c# routine and i think that actors model fits perfectly as a solution for my problem. Unfortunately i have experience only with scala implementation.
Borba
  • 791
  • 1
  • 6
  • 6
75
votes
3 answers

How are the multiple Actors implementation in Scala different?

With the release of Scala 2.9.0, the Typesafe Stack was also announced, which combines the Scala language with the Akka framework. Now, though Scala has actors in its standard library, Akka uses its own implementation. And, if we look for other…
Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681
73
votes
3 answers

Akka Actor not terminating if an exception is thrown

I am currently trying to get started with Akka and I am facing a weird problem. I've got the following code for my Actor: class AkkaWorkerFT extends Actor { def receive = { case Work(n, c) if n < 0 => throw new Exception("Negative number") …
fresskoma
  • 25,481
  • 10
  • 85
  • 128
70
votes
3 answers

Design patterns/best practice for building Actor-based system

I am struggling to find any decent links to design patterns, best practice or good, basic architectural principles that should be used in building Actor-based apps. Those few that I know of are: Blog posts, articles, WIKIs, guides OTP Design…
Vasil Remeniuk
  • 20,519
  • 6
  • 71
  • 81
63
votes
1 answer

What does a single apostrophe mean in Scala?

In this slide show on ScalaActors.pdf what does the single quote indicate when the message is sent to the pong actor? class Ping(count: int, pong: Pong) extends Actor { def act() { pong ! 'Ping // what does the single quote indicate??? …
JeffV
  • 52,985
  • 32
  • 103
  • 124
63
votes
2 answers

Is F# really faster than Erlang at spawning and killing processes?

Updated: This question contains an error which makes the benchmark meaningless. I will attempt a better benchmark comparing F# and Erlang's basic concurrency functionality and inquire about the results in another question. I am trying do…
Tristan
  • 6,776
  • 5
  • 40
  • 63
1
2 3
99 100