In this chapter, we took a deeper dive into working with the
Thread class. Through our examples, we learned how to coordinate threads in a more advanced way. We learned how to use the
try..catch block, the
Monitor object, locks,
Sleep methods to coordinate activities between threads.
We also introduced two common design patterns that we will explore in much more detail in the later chapters—the pipelining and the producer-consumer patterns. These are commonly used to solve problems in a parallel application. They are good ways to segment the work that can be done in parallel from the work that cannot be done in parallel.
As we have discussed, this type of parallel programming is called heavyweight concurrency because the ...