Kernel mode: Spin Lock, Queued Spin Lock, Fast Mutex, Executive Resource, and Mutex
User mode: CRITICAL_SECTION, Mutex
Note that CRITICAL_SECTION is best for intra-process inter-thread synchronization,
providing you don't need to do a multiple wait, use a timeout, or recover from a deceased
thread that is holding the CRITICAL_SECTION. Mutex for inter-process synchronization, if
you need a waitable object (for multiple waits), need a timeout, or have to deal with
deceased threads. Kernel primitives, except KMUTEX, have no equivalents in user space and
therefore are irrelevant. And it is very dangerous to try to share a KMUTEX with user
space by wrapping it in a handle, or a Mutex with kernel space by having someone unwrap
the handle to get to the KMUTEX. Doing so will ultimately leave you blue. [And I mean
Blue Screen Of Death. Note that I teach kernel synchronization in my Device Driver
course. Nothing in kernel synchronization is applicable in user space]
joe
Joseph M. Newcomer [MVP]
email: XXXX@XXXXX.COM
Web:
http://www.yqcomputer.com/
MVP Tips:
http://www.yqcomputer.com/