Thoughts from the EPS Windows Server Performance Team
Good Morning AskPerf! We’re continuing on with our mini-series on Synchronization Mechanisms today with a look at Mutexes. A mutex is a synchronization object. Mutexes ensure mutually exclusive (hence the term) access. In other words, while one thread has the mutex, all other threads are prevented from using it. Essentially any lock that grants mutually exclusive access is a mutex. There are different types of mutexes – and determining which one will be used is based on a number of factors, including:
As with our last two posts, we’re not going to delve too deeply into programming concepts. However, here are the different types of Windows mutex as listed on MSDN:
OK, let’s switch gears slightly and discuss the three types of spin lock mentioned above. A spin lock is exactly what it sounds like. When a thread owns a spin lock, all the other threads waiting to acquire the lock “spin” until the lock is available. The threads don’t block – so they aren’t suspended or paged out – they retain control of the CPU. That prevents execution of other code at a same (or lower) IRQL. For more on IRQL, see our earlier post. Spin locks are allocated from nonpaged memory or nonpaged pool that is allocated by the caller.
As indicated above, there are three different types of spin lock:
OK, that’s all for this post. The resources below provide some additional information on mutexes and spin locks. In our next post, we’ll talk about Semaphore Objects. Until next time …
- CC Hameed
I have a ? I am trying 2 defragmenter (c) and I get this error message:
disk defragmenter has detected that chkdsk is scheduled to run on the volume (c)
Please run chkdsk/f.
is there a tut that I can go by 2 get this figure out ?
I do check the chkdsk exe, but I don't have the chkdsk/f.
Please help me
Put a space between the 'k' character and the '/' character.