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 and ...

Get More Effective C#: 50 Specific Ways to Improve Your C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.