The Mach operating system depends on message-based communication, using ``ports'' to represent message end-points. Ports are protected with capability-like ``send rights'' and ``receive rights.'' All system operations are performed using messages; for example, virtual memory faults are converted into messages sent to the backing-store port of the associated memory object. Other communication models, such as TCP byte streams, are constructed on top of this message-passing layer.
Each port has a queue of pending messages. A thread may use the msg_receive() system call to retrieve a message from the queue of a single port, or wait for a message to arrive if the queue is empty.
A thread with receive rights for many ports may create a ``port set'', a first-class object containing an arbitrary subset of these receive rights. The thread may then invoke msg_receive() on that port set (rather than on the underlying ports), receiving messages from all of the contained ports in FIFO order. Each message is marked with the identity of the original receiving port, allowing the thread to demultiplex the messages. The port set approach scales efficiently: the time required to retrieve a message from a port set should be independent of the number of ports in that set.
Port sets are appropriate for a model in which all communication is done with messages, and in which the system provides the necessary facilities to manage message ports (not necessarily a simple problem). Introducing port sets into UNIX, where most communication follows a byte-stream model, might require major changes to applications and existing components.