O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

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

Pausing and restarting threads

It is important in a lot of cases to coordinate and wait on threads. Take, for example, a pipelining design. Once we start a group of concurrent threads, we then need to wait on them all to finish, collate their results, and move onto the nonconcurrent section. We need to know when threads finish and what their results are, so we can determine how to proceed.

There are several ways to coordinate and wait between threads. In the following example, we will show how you can check to see if a thread is still alive and processing and then wait on all of the threads to complete their bitmap processing work before we continue the rest of the application and reassemble the bitmap pieces.

In this example, we will use the

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