Dart Isolate vs Akka
Asked Answered
B

2

6

From what I have understood, Dart isolate is like Akka actors.

However, what I couldn't figure out is if dart:isolate serves similar purpose as Akka does. Is there a fundamental difference between the two ?

Is dart:isolate a framework for actor model programming just like Akka?

Is it that dart:isolate more similar to scala actors than akka.

Breathtaking answered 10/4, 2014 at 16:13 Comment(0)
M
3

Isolates differ from Akka actors in many ways:

  • isolates do not share memory, that is, are isolated just like Unix processes are

  • as a result, when an isolate is spawned using spawn, all data in the current isolate are duplicated

  • isolate has no central method like receive - or, better say, that method is hidden under the hood. That method takes tasks from execution queue and executes them one by one. This is similar to as GUI thread works. Task are created with callback methods inside. Callbacks are used everywhere in Dart.

Mcalpin answered 10/4, 2014 at 17:22 Comment(5)
How does Akka share memory? This looks to me like it doesn't Distinguishing Features (of Akka) ... Concurrency is message-based and asynchronous; typically no mutable data are shared and ...Steere
"typically" means that programmer should avoid using shared memory, but Akka cannot prevent to do so - doc.akka.io/docs/akka/snapshot/general/jmm.htmlMcalpin
Thanks for the update. This seems to be a limitation of Java. For isolates this is solved by default but has the disadvantage that only basic types like int/double/String/List/Map or List or Maps of those can be used for messages.Steere
From your answer, would it be correct to infer that isolates are better actors than Akka actors ? By "better" I mean closer to ideal actors.Breathtaking
@Breathtaking you mean Hewitt's actor model? in some aspects closer, in other (messages) - farther. I am not a fan of Hewitt's model, so being an "ideal actor" does not inspire me. I prefer en.wikipedia.org/wiki/Dataflow_programmingMcalpin
D
0

The description http://en.wikipedia.org/wiki/Akka_(toolkit) seems to be similar to what Dart isolates are.
Akka seems more advanced. There is no trancparency yet if you communicate to isolates on the same host or another host for example.

Decorum answered 10/4, 2014 at 16:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.