Skip to content

consider to use C++17 parallel algorithms #25

@yumetodo

Description

@yumetodo

As already mentioned at #23 , The cost of creating/destroying thread is expensive.
C++17 introduce C++17 parallel algorithms. MSVC's implementation use threadpool. So, instead of adapting Intel TBB(#23), we can use it.

Also, some unit test is too slow so that we can speed up by using C++17 parallel algorithms

Using C++17 Parallel Algorithms for Better Performance | C++ Team Blog

Scheduling in our implementation is handled by the Windows system thread pool. The thread pool takes advantage of information not available to the standard library, such as what other threads on the system are doing, what kernel resources threads are waiting for, and similar. It chooses when to create more threads, and when to terminate them. It’s also shared with other system components, including those not using C++.

For more information about the kinds of optimizations the thread pool does on your (and our) behalf, check out Pedro Teixeira’s talk on the thread pool, as well as official documentation for the CreateThreadpoolWork, SubmitThreadpoolWork, WaitForThreadpoolWorkCallbacks, and CloseThreadpoolWork functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions