参与者模式
基本概念
参与者模型推崇的哲学是“一切皆是参与者”,这与面向对象编程的“一切皆是对象”类似,但是面向对象编程通常是顺序执行的,而参与者模型是并行执行的。
参与者是一个运算实体,回应接受到的消息,同时并行的:
发送有限数量的消息给其他参与者;
创建有限数量的新参与者;
指定接受到下一个消息时的行为。
以上操作不含有顺序执行的假设,因此可以并行进行。
发送者与已经发送的消息解耦,是参与者模型的根本优势。这允许进行异步通信,同时满足消息传递的控制结构。
消息接收者是通过地址区分的,有时也被称作“邮件地址”。因此参与者只能和它拥有地址的参与者通信。它可以通过接受到的信息获取地址,或者获取它创建的参与者的地址。
参与者模型的特征是,参与者内部或之间进行并行计算,参与者可以动态创建,参与者地址包含在消息中,交互只有通过直接的异步消息通信,不限制消息到达的顺序。
使用参与者模式编程
一些编程语言使用了参与者模型或变种。这些语言包括:
早期参与者模式编程语言
Act 1, 2 and 3
Acttalk
Ani
Cantor
Rosette
后期参与者模式编程语言
参与者模式库及框架
参与者模式库及框架,允许用户在没有内置参与者模式的语言中进行编程。这些框架包括
注意这里没有列出全部框架和库。
参考资料
^Carl Hewitt; Peter Bishop and Richard Steiger.A Universal Modular Actor Formalism for Artificial Intelligence(PDF). IJCAI. 1973.
^Carl Hewitt. Viewing Control Structures as Patterns of Passing Messages Journal of Artificial Intelligence. June 1977.
^Henry Lieberman.A Preview of Act 1(PDF). MIT AI memo 625. June 1981.
^Henry Lieberman.Thinking About Lots of Things at Once without Getting Confused: Parallelism in Act 1(PDF). MIT AI memo 626. June 1981.
^Jean-Pierre Briot. Acttalk: A framework for object-oriented concurrent programming-design and experience 2nd France-Japan workshop. 1999.
^Ken Kahn. A Computational Theory of Animation MIT EECS Doctoral Dissertation. August 1979.
^William Athas and Nanette Boden Cantor: An Actor Programming System for Scientific Computing in Proceedings of the NSF Workshop on Object-Based Concurrent Programming. 1988. Special Issue of SIGPLAN Notices.
^Darrell Woelk. Developing InfoSleuth Agents Using Rosette: An Actor Based Language Proceedings of the CIKM "95 Workshop on Intelligent Information Agents. 1995.
^Dedecker J., Van Cutsem T., Mostinckx S., D"Hondt T., De Meuter W. Ambient-oriented Programming in AmbientTalk. In “Proceedings of the 20th European Conference on Object-Oriented Programming (ECOOP), Dave Thomas (Ed.), Lecture Notes in Computer Science Vol. 4067, pp. 230-254, Springer-Verlag.”, 2006
^Darryl K. Taft.Microsoft Cooking Up New Parallel Programming Language. Eweek.com. 2009-04-17 [2012-12-02].
^Humus. Dalnefre.com. [2012-12-02].
^Carlos Varela and Gul Agha. Programming Dynamically Reconfigurable Open Systems with SALSA. ACM SIGPLAN Notices. OOPSLA"2001 Intriguing Technology Track Proceedings. 2001, 36.
^Philipp Haller and Martin Odersky.Event-Based Programming without Inversion of Control(PDF). Proc. JMLC 2006. September 2006.
^Philipp Haller and Martin Odersky.Actors that Unify Threads and Events(PDF). Technical report LAMP 2007. January 2007.
^Srinivasan, Sriram; Alan Mycroft.Kilim: Isolation-Typed Actors for Java(PDF). European Conference on Object Oriented Programming ECOOP 2008. Cyprus. 2008 [2008-07-24].
^Commit History · kilim/kilim · GitHub. Github.com. [2012-12-02].
^Commit History · stevedekorte/ActorKit · GitHub. Github.com. [2012-12-02].
^Commit History · haskell-distributed/distributed-process · GitHub. Github.com. [2012-12-02].
^Commit History · CloudI/CloudI · GitHub. Github.com. [2014-03-19].
^Changes - retlang - Message based concurrency in .NET - Google Project Hosting. Code.google.com. [2012-12-02].
^jetlang-0.2.9-bin.zip - jetlang - jetlang-0.2.9-bin.zip - Message based concurrency for Java - Google Project Hosting. Code.google.com. 2012-02-14 [2012-12-02].
^Pulsar documentation.
^Changes — Pykka 1.2.0 documentation. pykka.org. [2014-03-30].
^Theron. Theron-library.com. [2012-12-02].
^Theron. Theron-library.com. [2012-12-02].
^Pulsar GitHub.
^Changes - actor-cpp - An implementation of the actor model for C++ - Google Project Hosting. Code.google.com. [2012-12-02].
^Commit History · s4/s4 · GitHub. Github.com. [2012-12-02].
^Tags · actor-framework/actor-framework · GitHub. Github.com. [2014-07-23].
^celluloid | RubyGems.org | your community gem host. RubyGems.org. [2012-12-02].
^Community: Actor Framework, LV 2011 revision (version 3.0.7). Decibel.ni.com. [2012-12-02].
^QP Active Object Frameworks - Browse Files at. Sourceforge.net. [2012-12-02].
免责声明:以上内容版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。感谢每一位辛勤著写的作者,感谢每一位的分享。
- 有价值
- 一般般
- 没价值