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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With