|
|
MDI drivers that are not specifically multithreaded are expected to be single-threaded and MP-safe. See ``Multithreaded drivers''.
A single-threaded driver being run on a multiprocessing system executes on a single CPU only. This means that the synchronization variables used for a single-threaded driver are adequate to protect critical code regions even in a multiprocessing environment. To avoid the system performance problems that can arise when drivers are restricted to a the default CPU, MDI drivers should use the functions that are provided to implement a coarse lock that enables a single-threaded driver to execute on any online CPU:
Always test that a single-threaded driver continues to function correctly when used in a multiprocessor configuration and that a multithreaded driver functions correctly when used in a uniprocessor configuration to verify compatibility with the environment and to evaluate system/driver performance. SVR5 MDI drivers can use the spm utility to evaluate driver performance.
We encourage device driver writers to make their driver multiprocessor-aware. Overall system performance improves if a driver is multi-threaded.