
GC Pauses and Safe Points in the CLR - matthewwarren
http://www.mattwarren.org/2016/08/08/GC-Pauses-and-Safe-Points/
======
bjourne
I wonder why a rewritten noop rotine is used instead of a segfaulting
instruction for polling, like HotSpot uses? E.g MOV [RIP+<addr>], EAX with
[RIP+<addr>] pointing to memory that gets write-protected when GC is needed. I
think that should be much faster than CALL <addr> with the routine at <addr>
being rewritten.

~~~
matthewwarren
I wondered the same after I figured out what the CLR does.

I don't honestly know, maybe for the CLR using CALL <addr> is fast enough?

I'd be interested to know the real reason though.

------
xenadu02
This is interesting but there is a lot more to .NET GC. There is a concurrent
GC, low-latency "pause-less" GC, etc.

~~~
matthewwarren
> This is interesting but there is a lot more to .NET GC.

Yeah, but one post covering the entire .NET GC would be huge!! This post was
only meant to cover GC Pauses and Safepoints.

> There is a concurrent GC, low-latency "pause-less" GC, etc.

I covered some of these topics in other posts, see:

\- [http://mattwarren.org/2016/02/04/learning-how-garbage-
collec...](http://mattwarren.org/2016/02/04/learning-how-garbage-collectors-
work-part-1/) \- [http://mattwarren.org/2016/06/20/Visualising-the-dotNET-
Garb...](http://mattwarren.org/2016/06/20/Visualising-the-dotNET-Garbage-
Collector/) \- [http://mattwarren.org/2016/08/16/Preventing-dotNET-
Garbage-C...](http://mattwarren.org/2016/08/16/Preventing-dotNET-Garbage-
Collections-with-the-TryStartNoGCRegion-API/)

