C++11 Multi-threaded Programming: Task-Queue Patterns - Part 2

Introduction In the previous post , we discussed three task-queue patterns using thread synchronization primitives introduces in C++11. In this post, we will implement these patterns using C++11 std:: async features. Here is the recap of the previous post: Single Producer and Single Consumer Basic model with one consumer thread appropriate for lightweight processing of work items sequentially. Single Producer and Multiple Consumers - Unordered Delivery Our work items are processed concurrently. The application hook (ReadyForDelivery) needs to be thread-safe as it gets called by multiple consumer threads. We will adapt this model if ordering is not desired by the application and concurrent processing is needed for further processing by the application logic. Single Producer and Multiple Consumers - Ordered Delivery Here also, our work items are processed concurrently but additionally, the work items are delivered sequentially to the applicati...