Why do CSP implementations only cover channels?

862 Views Asked by At

In the book about Communicating Sequential Processes a lot of time is spent defining events, which have no direction and can involve multiple independent processes.

Only in chapter 4 are channels introduced, which are directed and involve 2 processes.

Yet all implementations of CSP including occam, Go, LuaCSP and clojure.core.async only implement channels.

Even though most practical problems can be solved with (broadcast) channels, I wonder why the book spends so much time on them while nobody uses them.

2

There are 2 best solutions below

2
On BEST ANSWER

In Occam-pi, barriers are an important adjunct to channels. With a barrier, each enrolled process waits on the barrier until they have all done so. At this point they are all released. This is an example of a non-channel form of CSP event.

Occam-pi also has an extended rendezvous using channels. This is a quite different pattern of usage of channels, very similar to the rendezvous in Ada.

2
On

Well first of all the book happened before the implementations. Therefore your question is better formulated as:

Why does no implementation of CSP put a major focus on events even though the book emphazises them greatly.

Basically, making events a first-class citizen of a language gives it a certain usage specificity that would probably be too narrow for a general purpose programming language.

Additionally, you can easily implement events on channels (and other constructs), in case you are into event driven programming.