language-icon Old Web
English
Sign In

Channel (programming)

In computing, a channel is a model for interprocess communication and synchronization via message passing. A message may be sent over a channel, and another process or thread is able to receive messages sent over a channel it has a reference to, as a stream. Different implementations of channels may be buffered or not, and either synchronous or asynchronous. In computing, a channel is a model for interprocess communication and synchronization via message passing. A message may be sent over a channel, and another process or thread is able to receive messages sent over a channel it has a reference to, as a stream. Different implementations of channels may be buffered or not, and either synchronous or asynchronous. Channels are fundamental to the process calculus approach to concurrency, and originated in communicating sequential processes (CSP), a formal model for concurrency, and has been used in many derived languages, such as occam, and Limbo programming language (via Newsqueak and the Alef programming language). They are also used in Plan 9 from Bell Labs's libthread, as well as in Stackless Python and the Go programming language. Channels modeled after the CSP model are inherently synchronous: a process waiting to receive an object from a channel will block until the object is sent. This is also called rendezvous behaviour.Typical supported operations are presented below using the example of the libthread channel API. The Multithreading library, libthread, which was first created for the operating system Plan 9, offers inter-thread communication based on fixed-size channels. 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. The XMOS programming language XC provides a primitive type 'chan' and two operators '<:' and ':>' for sending and receiving data from a channel.

[ "Message passing", "Synchronization", "Asynchronous communication", "Communication channel", "Message broker" ]
Parent Topic
Child Topic
    No Parent Topic