This project is showcasing the WinRT ThreadPool class demonstrating how to create multiple threads to perform lengthy tasks and then communicate the results via "event-like" callbacks. In this example, we are using 5 threads and each thread is checking whether a rather large number is prime or not.

Be careful when checking very large numbers. If they are composite then the result will be shown very fast but if you hit a large prime (larger than what you see in the screenshot) then the algorithm will take a VERY long time to finish. Suggestions for improvement are welcome in this area!

Name:  MultiThreadingPrimes.jpg
Views: 302
Size:  29.2 KB

Here is the demo project: MultiThreadingTB.zip

Requirements: Windows 10 or later!