The free lunch is over and we definitely have to scale by adding more and more cores. Wether we like it or not, we’ll be coding and debugging multi-threaded applications in the near future.

The bad news is multi-threading is hard to deal with. Really hard. What is surprising is that even some thick reference books covering the subject are mixing up concepts and adding more to the reader’s confusion. I’ve run into such an example recently while having a look at the multi-threading chapter of  C# 3.0 Cookbook, 3rd Edition –then I discovered a similar example in More Effective C#: 50 Specific Ways to Improve Your C#. We will go into the details in this post.

Continue reading