Plan B User's Manual


Name

chan ­ Channel boxes.

Synopsis

/b/chan

Description

The box /b/chan is used to contain boxes that represent communication channels. The user is expected to make new channels under /b/chan as needed.

A channel box can be used to copy another box to it, or to copy it to another box. Each of the boxes copied behaves as a message in the channel. Since the channel has no buffering, it blocks a sender when no one is receiving and it blocks a receiver when no one is sending. Although it serves the same purpose than UNIX pipes, it is closer to Inferno channels than to pipes, hence the name.

It is typical to use channels as the source for a link(2) operation, to turn an existing box into a channel. See proc(4) for an example of this.

Announces

None

Source

/src/b/port/chanbox.c and /src/b/port/chan.c


Plan B User's Manual. First edition.