In this chapter, we have explored four more concurrency patterns, in which two of them have been designed as simple drop-in replacements for the original code and two are required for rearchitecting parts of the code.
The thread pool pattern is a variation of an object pool pattern, and is designed to store threads. Instead of creating a new thread each time we need to execute some code in the background, we can take the already created thread from a thread pool and ask it to run our code. This speeds up the performance of the program and allows for some other interesting tricks.
After that, we were introduced to the concept of messaging. Although it belongs to architectural patterns, a proper use of this concept requires detailed knowledge of the tools that are offered by the operating system and the programming environment. This chapter explored three...