In its current implementation, SpinWait performs CPU-intensive spinning for 10 iterations before yielding. However, it doesn’t return to the caller immediately after each of those cycles: instead, it calls to spin via the CLR (and ultimately the operating system) for a set time period. This time period is initially a few tens of nanoseconds, but doubles with each iteration until the 10 iterations are up. This ensures some predictability in the total time spent in the CPU-intensive spinning phase, which the CLR and operating system can tune according to conditions. Typically, it’s in the few-tens-of-microseconds region — small, but more than the cost of a context switch.
Still trying to understand why pattern matching has been introduced to the switch statement..none of the OO developers will use that anyway, maybe in the next few years we might get what scala offers to the community. I like C# but the way its pushing further comparing to some of the other popular languages and in this modern area where more and more we as developers are involved in building distributed applications, pattern matching, records etc would be much more appreciated and will speed up the dev process and the productivity. maybe this sounds rude but in fact that’s the reality which we are facing everyday.