Go to main content

STREAMS Programming Guide

Exit Print View

Updated: November 2020
 
 

Overview of Streams in Kernel Space

Overview of STREAMS describes a stream as a full-duplex processing and data transfer path between a STREAMS driver in kernel space and a process in user space. In the kernel, a stream consists of a stream head, a driver, and zero or more modules between the driver and the stream head.

The stream head is the end of the stream nearest to the user process. All system calls made by user-level applications on a stream are processed by the stream head.

Messages are the containers in which data and control information is passed between the stream head, modules, and drivers. The stream head is responsible for translating the appropriate messages between the user application and the kernel. Messages are simply pointers to structures such as mblk and dblk that describe the data contained in them. Messages are categorized by type according to the purpose and priority of the message.

Queues are the basic elements by which the stream head, modules, and drivers are connected. Queues identify the open, close, put, and service entry points. Queues also specify the parameters and the private data for use by modules and drivers, and are the repository for messages destined for deferred processing.

In this chapter, the word "modules" refers to modules, drivers, or multiplexers, except where noted.