什么是数据流并发的良好激励示例? [英] What is a good motivating example for dataflow concurrency?

查看:166
本文介绍了什么是数据流并发的良好激励示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解数据流编程的基本知识,并在 Clojure中遇到了一些问题API 来自Jonas Boner的演讲< a>, GPars 在Groovy等,我知道它在像Io这样的语言中流行(虽然我没有研究Io)。

I understand the basics of dataflow programming and have encountered it a bit in Clojure APIs, talks from Jonas Boner, GPars in Groovy, etc. I know it's prevalent in languages like Io (although I have not studied Io).

我缺少的一个令人信服的理由是,在构建并发程序时将数据流作为范例。为什么要使用数据流模型而不是可变状态+线程+锁模型(通常在Java,C ++等)或actor模型(常见于Erlang或Scala)或其他?

What I am missing is a compelling reason to care about dataflow as a paradigm when building a concurrent program. Why would I use a dataflow model instead of a mutable state+threads+locks model (common in Java, C++, etc) or an actor model (common in Erlang or Scala) or something else?

特别是,虽然我知道上面的语言(和Scala和Ruby)的库支持,我不知道一个单一的程序或库是这个模型的海报儿童用户。谁在使用它?为什么他们发现它比我提到的其他模型更好?

In particular, while I know of library support in the languages above (and Scala and Ruby), I don't know of a single program or library that is a poster child user of this model. Who is using it? Why do they find it better than the other models I mentioned?

推荐答案

我也有一个错误的例子。它不实现干净的actor模型,它没有并发问题,但它使用DF架构,并且普遍:任何电子表格软件(例如MS Excel)。

I have a wrong example, too. It does not implement a clean actor model, and it has no concurrency issues, but it uses DF architecture, and extremly popular: any spreadsheet software (e.g. MS Excel).

修改单元格时,它会向引用它的单元格发送重新计算信号。 Altough,当你使用一个工作表,它变得越来越大,你可以感觉到数据流编程的真正味道 - 工作的重点将改变:

When you modify a cell, it sends "recalculate" signal to the cells which have reference to it. Altough, when you are working with a sheet, which becomes bigger and bigger, you can feel the real taste of the dataflow programming - the focus of the work will change:


  • 公式创建失去其初始重要性(您会发现自己只是克隆了相同的3-4个公式),

  • 布局变得更加重要:

如果我们意识到,公式是组件,引用是消息,我们得到数据流编程的通常方式:首先,我们创建一些组件,然后我们与他们构建一个数据流图。如果组件太大,我们将它们分成更小的组件。最后,我们选择一个可视化组件来显示一个眼睛结果的结果。

If we realise, that formulas are components, and references are messages, we get the usual way of dataflow programming: first, we're creating some components, then we're building a dataflow graph with them. If components are too big, we split them into smaller ones. Finally, we're picking a visualization component for an eye-candy result presentation.

这篇关于什么是数据流并发的良好激励示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆