Task-based work division assigns different responsibilities to different threads. Instead of giving each thread a chunk of data on which to perform the same operation, it makes threads specialists. They may use the same data, but for different purposes. Each thread can focus on one ongoing task, while another thread supplies data or triggers an event it must handle. section 8.1.3
Keeping an application responsive
A single-threaded application might do a little work on task A, then task B, check for key presses and network data, and repeat. Task A must save its state and return to the loop regularly. As more tasks enter the loop, responses can become slow; a long-running task may freeze the interface. Running the tasks in separate threads avoids making each task explicitly yield to that loop. section 8.1.3
Choose the division to fit the work. Task-based division separates concerns; data-based division gives threads portions of a large dataset. For data-heavy operations, inspect access patterns and profile alternatives on the target architecture: changing the division can improve performance without changing the basic algorithm. section 8.1.3 section 8.3.1
