问题描述
我在学习 OCCAM 和 CSP(通信顺序过程)时看到了一个问题.我找到了一些基本的答案,例如;
I saw a question while I was studying for OCCAM and CSP ( Communicating Sequential Processes ). I found some basic answers like;
- 它们都用于并行编程,
- 他们用问号(?)输入,
- 发送带有感叹号 (!) 的输出.
但我想了解更多关于它们共同特性的技术细节.
But I want to find out more technical details about their common features.
推荐答案
On CSP
Hoare 的 CSP 于 1979 年至 1984 年完成,当时他的关于 CSP 的书(今天有大约 260 多页) 于 1985 年首次出版.
On CSP
Hoare's CSP was completed during 1979 ~ 1984, when his Book on CSP ( today having some 260+ pages ) was first published in 1985.
这个最终版本的 CSP 还包括通道,允许进程间通信和同步机制.
This final version of CSP also includes channels, that allow process-to-process communication and synchronisation mechanics.
David May 与 Hoare 在牛津的团队一起,在 CSP 的发展过程中同时开发了 occam
,这是一种与 InMOS 紧密结合的语言> 非常创新且非常先进的TRANSPUTER 处理器网络,有意将 CSP 融入实用的编程语言.
David May, along with Hoare's team at Oxford, has concurrently with the evolution of CSP developed occam
, a language tightly knit to the InMOS very innovative and very advanced TRANSPUTER processor-networks, deliberately intended to blend CSP into a practical programming language.
当代语言可能源自 occam
语言概念的无与伦比的高级功能.
There are un-"paralleled" advanced features of the occam
language concept that contemporary languages may source from.
一个有趣的示例代码 (C) 2000,Fred Barnes 和 Peter Welch 的一些修复/修改说明了语言/CSP 频道概念在酒吧模拟器的玩具示例上的力量,提供啤酒,同时保持代码可读并富有表现力.
A funny sample code (C) 2000, Fred Barnes with some fixes/mods from Peter Welch illustrates the powers of the language/CSP channel concepts on a toy example of a Bar-simulator, serving beers, while keeping the code readable and expressive.
-- ...(cleared for clarity >>> http://frmb.org/download/bar.occ )
-- ..
-- .
--{{{
PROC bar.tender ( []CHAN OF BYTE req, rsp,
CHAN OF INT mode.change,
CHAN OF O.REQ d.chan,
SEMAPHORE d.sem,
CHAN OF BOOL kill
)
CHAN OF BYTE spinal.chord:
CHAN OF BOOL kill.brain, kill.body:
PAR
--{{{ terminator SEQ, BUT DECLARED TO RUN IN TRUE-PARALLEL EXEC WITH bar.brain() & bar.body()
BOOL any:
SEQ -- SEQ:
kill ? any
kill.brain ! any -- order is
kill.body ! any -- important
--}}}
bar.brain ( req, spinal.chord, mode.change, kill.brain )
bar.body ( spinal.chord, rsp, d.chan, d.sem, kill.body )
:
--}}}
在下一波中,CSP 和 Occam 相互影响(例如在 奥卡姆编程定律(约 90 页,扫描副本) ),涉及与 分布式实时处理和许多其他感兴趣的高级领域.
In next waves, CSP and Occam have influenced each other ( for example in The Laws of Occam Programming ( ~90 pages, scanned copy ) ), touching as advanced topics as distributed real-time processing and many other advanced fields of interest.
这篇关于occam和csp的共同特点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!