Multiprocessor Support (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

Writing code to safely run on machines with multiple concurrently executing processors is an essential part of writing a portable driver for Microsoft Windows 2000 and later versions. A network driver must be multiprocessor-safe and must use the provided NDIS library functions.

In a uniprocessor environment, a single processor runs only one machine instruction at a time, even though it is possible for a NIC or other device to interrupt the current execution stream when packets arrive or as timer interrupts occur. Typically, when manipulating data structures such as packet queues, a driver disables interrupts on the NIC, performs the manipulation, and then reenables interrupts. Many threads in a uniprocessor environment appear to run simultaneously but actually run in interleaved time slices.

In a multiprocessor environment, processors simultaneously run several machine instructions. A driver must synchronize so that when one driver function manipulates common data structures, the same or another driver function on another processor does not attempt to modify shared data at the same time. All driver code is reentrant in an SMP machine. To eliminate this resource protection problem, Windows 2000 and later device drivers use spin locks.

 

 

Send comments about this topic to Microsoft