DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
MDI style guidelines

Multiprocessor-safe drivers

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:


DDI drivers
mdi_tx_if(D3mdi), mdi_tx_if_deinit(D3mdi), mdi_tx_if_disable(D3mdi), mdi_tx_if_enable(D3mdi), mdi_tx_if_init(D3mdi)

ODDI drivers
mditx_interface(D3mdi), mditx_interfaceMT(D3mdi), mditx_register(D3mdi), mditx_registerMT(D3mdi),

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.


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005