I would like to compile a list of all possible conditions making Monitor go to kernel-mode / use kernel sync object.
Sync block has a field to reference kernel object hence I deducted that lock
will go to kernel-mode sometime.
I found this : Lock (Monitor) internal implementation in .NET
but it has too many questions to be answered and the only useful information is that the OP answered his own question by simply stating that the lock
will go to the kernel-mode sometime. Also there is no links to anything to support that answer.
My question is different - I want to know when exactly lock
will go to kernel-mode (not if and not why - when).
I am more interested to hear about .NET 4 and 4.5 if there is any difference with older versions
EDIT: From the Richter book: "A sync block contains fields for a kernel object, the owning thread’s ID, a recursion count, and a waiting threads count."
See Question&Answers more detail:os