Other User Functions

This section describes the efficient STREAMS calls.

The previous example illustrates basic STREAMS concepts. However, more efficient STREAMS calls or mechanisms could have been used in place of those described earlier.

For example, the initialization process that created a getstrm process for each tty port could have been implemented as a "supergetty" by use of the STREAMS-related poll subroutine. The poll subroutine allows a single process to efficiently monitor and control multiple streams. The "supergetty" process would handle all of the stream and terminal protocol initialization and would create application processes only for established connections.

Otherwise, the M_PROTO notification sent to the getstrm process could be sent by the driver as an M_SIG message that causes a specified signal to be sent to the process. Error and status information can also be sent upstream from a driver or module to user processes using different message types. These messages will be transformed by the stream head into a signal or error code.

Finally, a I_STR operation could be used in place of a putmsg system call M_PROTO message to send information to a driver. The sending process must receive an explicit response from an I_STR operation by a specified time period, or an error will be returned. A response message must be sent upstream by the destination module or driver to be translated into the user response by the stream head.