Channel (programming): Difference between revisions

Content deleted Content added
typo
Citation bot (talk | contribs)
Alter: title. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | #UCB_webform 3638/3822
Line 40:
 
=== XMOS XC ===
The [[XMOS]] programming language [[XC (programming language)|XC]] provides a primitive type "chan" and two operators "<:" and ":>" for sending and receiving data from a channel.<ref>{{Cite web |url=https://www.xmos.com/node/17653?version=&page=23 |title=ArchivedXMOS copyProgramming Guide &#124; XMOS |access-date=2015-05-10 |archive-url=https://web.archive.org/web/20160304132653/https://www.xmos.com/node/17653?version=&page=23 |archive-date=2016-03-04 |url-status=dead }}</ref>
 
In this example, two hardware threads are started on the XMOS, running the two lines in the "par" block. The first line transmits the number 42 through the channel while the second waits until it is received and sets the value of x. The XC language also allows asynchronous receiving on channels through a select statement.