Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • 1
    An important complexity to note here is that the .NET memory model has certain strong guarantees that make your pseudocode not precisely equivalent to the (hypothetical, invalid C#) switch (t) { case typeof(int): ... } because your translation implies that variable t must be fetched from memory twice if t != typeof(int), whereas the latter would (putatively) always read the value of t exactly once. This difference can break correctness of concurrent code that relies on those excellent guarantees. For more info on this, see Joe Duffy's Concurrent Programming on Windows Commented Aug 30, 2017 at 18:39