Synchronization of timeout and bufcall Utilities

This section describes synchronization of timeout and bufcall utilities.

On multiprocessor systems, the timeout and bufcall utilities present a particular problem to the synchronization mechanism. These utilities specify a callback function. Multiprocessor-safe modules or drivers require that the callback functions be interrupt-safe.

Multiprocessor-safe modules or drivers are designed to run on any processor. They are very similar to multiprocessor-safe device drivers. Interrupt-safe functions serialize their code with interrupt handlers. Functions such as the qenable utility or the wakeup kernel service are interrupt-safe.

To support callback functions that are not interrupt-safe, the STR_QSAFETY flag can be set when calling the str_install utility. When this flag is set, STREAMS ensures the data integrity of the module. Using this flag imposes an overhead to the module or driver, thus it should only be used when porting old code. When writing new code, callback functions must be interrupt-safe.