共用方式為


Locks, Deadlocks, and Synchronization

This paper explains how to use synchronization mechanisms to protect shared memory locations in kernel-mode drivers for the Microsoft Windows family of operating systems. By following the guidelines in this paper, driver writers will be able to determine when synchronization is required, what synchronization mechanisms are provided by the operating system, and how each type of synchronization mechanism is used.

File name: Locks.doc

328 KB

Microsoft Word file

Get Office File Viewers

Note  

This paper builds on topics that are introduced in the companion white paper, Scheduling, Thread Context, and IRQL. Readers of this paper should be familiar with the information presented there. Included in this white paper:

 

  • Choosing a Synchronization Mechanism
  • Summary of Windows Synchronization Mechanisms
  • InterlockedXxx and ExInterlockedXxx Routines
  • Spin Locks
  • Fast Mutexes
  • Kernel Dispatcher Objects
  • Executive Resources
  • Callback Objects
  • Driver-defined Locks
  • Simultaneous Use of Multiple Synchronization Mechanisms
  • Preventing Deadlocks
  • Security Issues
  • Performance Issues
  • Best Practices for Driver Synchronization

 

 

Send comments about this topic to Microsoft