8.17.0.3
15.3 Channels
A channel both synchronizes a pair of threads and passes a value from one to the other. Channels are synchronous; both the sender and the receiver block until the (atomic) transaction is complete. Multiple senders and receivers can access a channel at once, but a single sender and receiver is selected for each transaction.
In addition to its use with channel-specific procedures, a channel can be used as a synchronizable event. A channel is ready for synchronization when Channel.get would not block; the channel’s synchronization result is the same as the Channel.get result.
Constructs a channel. The channel can be used with Channel.get or as
a synchronizable event to receive a value through the channel. The
channel can be used with Channel.put or through the result of
Channel.put_evt to send a value through the channel.
Blocks until a sender is ready to provide a value through ch. The
result is the sent value.
Blocks until a receiver is ready to accept the value val through
ch.
Constructs a synchronizable event that is ready for synchronization when
Channel.put(ch, val) would not block, and the event’s
synchronization result is the event itself.
annotation | |
An annotation that recognizes a synchronizable event created by
Channel.put_evt.