Content deleted Content added
message passing |
→Applications: init |
||
Line 18:
The [[OCaml]] event module offers typed channels for synchronization. When the module's send and receive functions are called, they create corresponding send and receive events which can be synchronized.
== Applications ==
In addition to their fundamental use for interprocess communication, channels can be used as a primitive to implement various other concurrent programming constructs which can be realized as streams. For example, channels can be used to construct [[futures and promises]], where a future is a one-element channel, and a promise is a process that sends to the channel, fulfilling the future.<ref>"[https://sites.google.com/site/gopatterns/concurrency/futures Futures]", ''[https://sites.google.com/site/gopatterns Go Language Patterns]''</ref> Similarly, [[iterator]]s can be constructed directly from channels.<ref>"[https://sites.google.com/site/gopatterns/object-oriented/iterators Iterators]", ''[https://sites.google.com/site/gopatterns Go Language Patterns]''</ref>
== References ==
{{reflist}}
{{refbegin}}
{{refend}}
== External links ==
* [http://swtch.com/usr/local/plan9/src/libthread/channel.c – Libthread Channel Implementation]
* [http://swtch.com/~rsc/thread/ Bell Labs and CSP Threads]
|