"It all started innocently enough. I found myself needing to calculate the area of a circle for the first time in .NET. This called, of course, for an accurate representation of pi. System.Math.PI is handy, but since it only provides 20 digits of precision, I was worried about the accuracy of my calculation (I really needed 21 digits to be absolutely comfortable). So, like any programmer worth their salt, I forgot about the problem I was actually trying to solve and I wrote myself a program to calculate pi to any number of digits that I felt like. "
This is the start of an excellent article series describing how to handle multithreading in windows forms. It's in three parts:
- How to perform long-running operations while still showing progress and keeping the UI responsive to user interaction
- How to leverage multiple threads to split the user interface (UI) from a long-running operation while communicating further user input to the worker thread to adjust its behavior
- How to more cleanly communicate between a UI thread and a worker thread, and how to call Web services asynchronously in a Windows Forms application