ch: Channel functions |
Top Previous Next |
The "Channel" communication mechanism is a FIFO queue mechanism that can be used for passing messages between threads.
A message is defined as an arbitrary block of data with a given length. The channel is initialized with chInit(), and the maximum number of messages in the channel is specified. A message is written to a channel by using chWrite() and read using chRead(). The Channel mechanism will automatically synchronize the access to the channel so that reading from an empty channel will block the calling thread until a message is written. Writing to a full channel will also block the calling thread until a message has been read.
Please refer to the section on Using Multithreading for more information on the use of channels.
The following channel functions exists:
The total message size available is for all channels combined. Each message occupies the size of the message + an overhead of 10 bytes. |