You know how it is. You’re thinking about JIT in .NET and the notion of safe points, and then you start wondering how safe points and asynchronous interrupts of a thread mix (though I am certainly no fan of exceptions injected using Thread.Abort). After a quick Google, I found Chris Brumme’s brilliant blog, something that I’ve gone to again and again to get the design rationale behind various parts of .NET. The blog hasn’t been updated for a number of years, and some parts of it are slightly dated, but it is a treasure trove of detailed design ideas behind the .NET framework.
This post answered all of my questions, and it was really interesting to read through the article on SEH that it referenced. As usual it taught me something. For example, the stack trace associated with an exception only contains the stack between the frame in which it is raised, and the frame it which it is caught (and not the full stack trace), though when you rethrow the exception the stack trace is extended with the new information. For example, in the following code, the first stack trace that is printed is only going to contain three frames (when there is no inlining).
Time to go back through all of the old blog posts one more time!
And while we’re talking about VMs, this post on using Java virtual machines in low latency environments is also really interesting.