Design patterns for Agent / Actor based concurrent design [closed]

橙三吉。 提交于 2019-12-02 15:55:14

Even if I cannot come up with any good real world examples that provide you with design patterns straight up, there are a few places to start.

The first is getting your head wrapped properly round the concepts. One book helping you do this is Making reliable distributed systems in the presence of software errors written by an Erlang Guru Joe Armstrong where explains Concurrency Oriented Programming in a very accessible way. It is in fact a Ph.D. thesis, but do not let that scare you. It is by far easier to read, and pleasant into the bargain, than most common text books.

Looking at actual systems normally means that you have to learn too much about the actual language for it too make sense just to evaluate things. For Erlang the documentation provides design methodology and behaviours(Erlang speek for design pattern libraries). This will illustrate the design patterns most commonly used in this setting. And these have proved to be effective in building large scale systems, i.e. millions of lines of code (comparable to a factor 4 to 10 of other languages such as Java) and milloins of concurrent processes running on one machine in distributed clusters of machines. A recent example of a real live system is Facebook Chat.

For the other frameworks I cannot really help you I am afraid.

An "actor" is itself the unifying pattern for concurrent programming (an asynchronous message queue plus an execution context for processing it), but there are many design patterns which assist in specifying aspects or elements of agent-based systems. Many of the most common can be found in Wikipedia's article on Concurrency Patterns. Some highlights:

If you haven't come across it already, Akka may be of interest to you -- it is a "purely" event-driven actor framework running on the JVM.

Simon

I asked a similar question here which had some reasonable answers that may help. I'm watching yours carefully. I haven't yet found something which has really helped me, but I am very actively looking.

I think the mind-shift is the single largest barrier to stepping to concurrent architectures and languages and until that is cracked developers are going to stick with easy to learn MS style paradigms. For it to really become mainstream it needs to find its way into schools and be taught alongside C# and VB.

My answer to the 2080 programmers question is "concurrently".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!