Locks, Deadlocks, and Synchronization

Updated: January 20, 2004
**
Download

Locks, Deadlocks, and Synchronization

DownloadLocks.doc
328 KB
Microsoft Word file
Updated: Jan 20, 2004
**

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.

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


Top of pageTop of page