In this article

The topics in this section show how your app can use the thread pool to do parallel work.

Your app can use the thread pool to accomplish work asynchronously in parallel threads. The thread pool manages a set of threads and uses a queue to assign work items to threads as they become available. The thread pool is similar to the asynchronous programming patterns available in the Windows Runtime because it can be used to accomplish extended work without blocking the UI, but the thread pool offers more control than the asynchronous programming patterns and you can use it to complete multiple work items in parallel. You can use the thread pool to:

Submit work items, control their priority, and cancel work items.

Schedule work items using timers and periodic timers.

Set aside resources for critical work items.

Run work items in response to named events and semaphores.

The thread pool is more efficient than managing threads individually because it reduces the overhead of creating and destroying threads. The thread pool has advantages over app-based thread management systems because it runs at the OS level. The means it has access to optimize threads across multiple CPU cores, and it can balance thread resources between apps docked side-by-side and when background tasks are running. Using the built-in thread pool is convenient because you focus on writing code that accomplishes a task instead of the mechanics of thread management.