Monitor.Enter vs Interlocked vs WaitHandle.WaitOne

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all.
What is difference between the methods found in the Monitor, Interlocked and
WaitHandle classes in terms of performance?
Is it true that Monitor.Wait uses the Interlocked class behind the scenes
(by using a spin-wait like mechanism)?
What does it mean that Interlocked doesn't switch to kernel mode and
WaitHandle does?
Do the Interlocked methods causes the calling thread to sleep until granted
exclusive access to the specified variables? (Does a context switch occur in
these methods?)
How do wait handles implemented anyway?
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top