<p>I am trying to understand CSP right now with the original paper, but I find it a bit hard to digest. I was wondering if there are recommended resources or tutorials on understanding communicating sequential process to complement with the original paper.</p>
<hr/>**评论:**<br/><br/>tmornini: <pre><p>The final piece for me was a mental image of a old fashioned bucket brigade. Imagine 20 people shoulder to shoulder, passing buckets from the first to the second ... all the way to the twentieth who empties it on to a fire, then passes it back to an identical group of twenty who carry it back to the water source.</p>
<p>Inline code execution is sequential, one line at a time, something we all understand.</p>
<p>So in traditional code execution one bucket would run down the line to the twentieth person, get dumped on the fire then be returned back to the water source to begin anew.</p>
<p>If we need more water we have two options: the traditional threaded model -- duplicate the entire setup and double the throughout.</p>
<p>CSP is modeled such that as soon as the first person hands the bucket to the second, he/she immediately fills a second bucket and waits for the second person to take it. Repeat this all the way around and after the first bucket gets emptied onto the fire, you now can empty a bucket every hand-off.</p>
<p>In CSP you keep the workers busy more frequently and get greater throughout than a single thread (though probably higher latency), but typically lower than a fully parallel thread solution (though easier to reason about and implement correctly).</p>
<p>I'm hoping that microprocessor designers can figure out a way make channel operations more efficient. If they do, CSP's benefits will really shine as today they're 2-3 orders of magnitude slower than a function call.</p>
<p>I'm not complaining! Go, and channels in particular, are better than sliced bread. Just saying that hardware based channel ops would kick Go and CSP into an even higher orbit.</p></pre>RalphCorderoy: <pre><p>Have you browsed Russ Cox's <a href="https://swtch.com/%7Ersc/thread/" rel="nofollow">Bell Labs and CSP Threads</a>? In particular, I'd recommend Cardelli and Pike's paper on Squeak as it's a simple language and it shows the compilation's C output that can be worked through to see how CSP can be implemented. Pike's Newsqueak is also worth a read.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传