Channel (programming): Difference between revisions

Content deleted Content added
Tags: Reverted possible conflict of interest
 
(3 intermediate revisions by 3 users not shown)
Line 53:
 
=== Go ===
This snippet of [[Go (programming language)|Go]] code performs similarly to the XC code. First the channel c is created, then a [[goroutine]] is spawned which sends 42 through the channel. When the number is put in the channel x is set to 42. Go allows channels to buffer contents, as well as non blocking receiving through the use of a select block.<ref>{{Cite web|url=https://golang.org/doc/effective_go.html#channels|title = Effective Go - the Go Programming Language}}</ref>
 
<syntaxhighlight lang="go">
Line 64:
 
=== Rust ===
[[Rust (programming language)|Rust]] provides asynchronous channels for communication between threads. Channels allow a unidirectional flow of information between two end-pointsendpoints: the <code>Sender</code> and the <code>Receiver</code>.<ref>{{cite web |title=Channels - Rust By Example |url=https://doc.rust-lang.org/rust-by-example/std_misc/channels.html |website=doc.rust-lang.org |access-date=28 November 2020}}</ref>
 
<syntaxhighlight lang="rust">
Line 86:
 
== List of implementations ==
* List of non-standard, library -based implementations of channels
 
* List of non-standard, library based implementations of channels
 
* For Scala:
Line 95 ⟶ 94:
** [[stlab]]<ref>{{cite web|url=https://stlab.cc/libraries/concurrency|title=stlab is the ongoing work of what was Adobe's Software Technology Lab. The Adobe Source Libraries (ASL), Platform Libraries, and new stlab libraries are hosted on github.|date=2021-01-31}}</ref> This implementation supports splits, and different merge and zip operations. Different executors can be attached to the individual nodes.
 
* For CRust:
** [[Tokio (software)|Tokio]]
** pthreadChannel<ref>{{cite web|url=https://github.com/gdavidbutler/pthreadChannel|title=pthreadChannel is a LGPL licensed library that provides a Channel style programming environment for POSIX threads in C hosted on GitHub.|date=2024-11-26}}</ref> This implementation provides features required for portable, robust and scalable parallel algorithms. The deceptively simple API unlocks powerful semantics demonstrated by non-trivial examples.
 
== References ==