Difference between the Concurrency Runtime Scheduler and Thread Pool

M N 6 Reputation points
2021-08-24T17:23:46.993+00:00

In the Visual Studio 2019 documentation it is stated in section "Task Scheduler (Concurrency Runtime)" that as of 2015 the concurrency::task class and related types in ppltasks.h use the Windows ThreadPool as their scheduler while algorithms like parallel_for still use the Concurrency Runtime as default scheduler. I have tried to reaseach the differences, but just can't find a clear answer. So here are my questions: What are the differences between the both scheduler in the way they work and/or how do they relate to each other? Do they have different scheduling policies and do both implement the work-stealing pattern?

Developer technologies | C++
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2021-08-25T02:54:15.63+00:00

    Hi,

    According to your description, I wonder if you want to know what is the difference between concurrency and parallelism?If so.

    Concurrency is when two or more tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. For example, multitasking on a single-core machine.

    Parallelism is when tasks literally run at the same time, e.g. on a multi-core processor.

    The Parallel Patterns Library (PPL) provides an imperative programming model that promotes scalability and ease-of-use for developing concurrent applications. The PPL builds on the scheduling and resource management components of the Concurrency Runtime.

    Concurrency can occur without parallelism: for example, multitasking on a single processor system.

    Parallelism is a specific form of concurrency requiring multiple processors (or a single processor capable of multiple engines of execution, such as a GPU).

    With concurrency, multiple threads make forward progress, but not necessarily simultaneously.

    With parallelism, threads literally execute in parallel, allowing multi-threaded programs to utilize multiple processors.

    Best Regards,

    Jeanine


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.