4

How can the difference between 'Dataflow Programming' and 'Actor model' be described? As far as I understand, they are not unrelated but yet are not the same. Is DF a wider concept, which gist is the distinction from Control Flow model, while the Actor model is more elaborated and theoretically grounded inheritor of DF?

pavel.baravik
  • 689
  • 1
  • 11
  • 21

2 Answers2

13
  • Dataflow is deterministic which allows parallelism.
  • Actors are non-deterministic which allows concurrency.
Jonas Bonér
  • 401
  • 4
  • 5
  • 3
    I did not think about this in such a way. Could you please elaborate a bit? 'Is deterministic' - does this mean that DF graph is hard-coded, thus we get the same result for same input; while Actor model allows dynamic graph reconfiguration, hence it is non-deterministic (at least may be so), right? But I cannot see a link between Parallelism vs concurrency and Deterministic vs Non-deterministic.. – pavel.baravik Sep 19 '13 at 15:20
  • Seems like here is an explanation: http://stackoverflow.com/questions/8582580/why-is-concurrent-haskell-non-deterministic-while-parallel-haskell-primitives-p appropriate for me. BTW could you please recommend a CS literature where the distinction you've provided would be described? – pavel.baravik Sep 19 '13 at 16:06
  • 5
    The best book on declarative/dataflow concurrency is [Concepts, Techniques, and Models of Computer Programming](http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/0262220695) by Peter Van Roy and Seif Haridi. It does a great job explaining the basics and how how it relates to both logic, FP and imperative style, covering actors, shared state concurrency and more on the way. Highly recommended. – Jonas Bonér Sep 30 '13 at 08:34
  • 10
    Deterministic dataflow also allows for concurrency http://sites.uclouvain.be/blog-ingi/2011/12/making-concurrency-easy-with-deterministic-dataflow/. Also dataflow is not necessarily deterministic. – Jean Vincent Oct 01 '13 at 22:49
  • 1
    And what about deterministic algorithm if I put a random number generator somewhere into the middle of the data flow? ;-) – inf3rno Aug 19 '14 at 11:17
4

DF is wider. A DF node may have several input ports, and is fired when all inputs are set. An Actor is a DF node with single input port. Colored Petri Net is even wider, allowing several transitions to be fed from single place, but it is hard to implement.

A DF implementation in Java can be found at Dataflow4Java.

Alexei Kaigorodov
  • 13,189
  • 1
  • 21
  • 38