O'Reilly logo

More Effective C#: 50 Specific Ways to Improve Your C# by Bill Wagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Multithreading in C#

Moore’s law has changed. Our computers continue to get faster, but not by increasing clock speed. Instead, computers are getting faster by adding cores. As this trend continues, your daily life will include more multithreaded programs than it currently does.

Multithreaded programming is difficult, and it’s easy to get it wrong. Subtle bugs occur when threads switch in a particular location. Unless you examine every line of code in your program and consider what happens if a task is switched, something likely will go wrong later. Somewhere, someday, a task switch will happen at a different location from one you reproduced in your testing, and your program will break. That makes it hard to code your programs correctly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required