What is really happenning when GC kicks in the user thread?
===

I saw these diagrams like here: http://msdn.microsoft.com/en-us/library/ee787088.aspx
for a good few years and I thought I understood them.. However when I tried to imagine what is going on in the thread actually I couldnt..

Lets say - when GC runs not on a dedicated thread but in the thread which triggered GC.

Look at the part called "What Happens During a Garbage Collection".

See the red arrow - this supposed to be GC running on the user thread.

So lets say I have a worker method which runs in a thread and that worker runs a loop. And then at some point of time GC kciks in..

my question is - what exactly is going to happen to my thread whem GC start and then finishes.

 - **Is there going to be a context switch?** 
 - **Will be new thread context allocated and new stack loaded for GC to run?** 
 - **How exactly GC code being executed in someone else's thread** (most puzzling for me)...
   the thread has stack allocated and the code is loaded.. how GC code
   got executed - I cant even begin to imagine this piece.

