C++ threading for multi-threaded low latency applications
The first component we will build is a very small one but still quite fundamental. This section will design and implement a method of creating and running threads of execution. These will be used in many different parts of a full low-latency system, depending on the design of the different sub-components in the system. Depending on the design of the system, different components might work together as a pipeline to facilitate parallel processing. We will use the multi-threading framework in exactly such a way in our electronic trading systems. Another use case is to pass off non-critical tasks such as logging onto disk, computing statistics, and so on to a background thread.
Before we move on to the source code that creates and manipulates threads, let us first quickly define a few useful macros. We will use these functions in many places in the source code that we will be writing in this book, starting with this chapter.
...