Learning by Example: Divide and Conquer

The Divide and Conquer application is a monolithic forms-based application. It reads in a sample file of decimal values and then computes the average for all of the values in the file. You can tell the application whether to use two threads (created from the thread pool) to process the file or to simply use the application's primary thread to process the file. If you elect to multithread the processing, the application will split the file content into two. One thread will process the “front half,” and one will process the “back half.”

Each thread will be responsible for updating two global variables that hold the running total and the current count of values processed. They will also update a count variable ...

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library 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.