[PATCH] D33977: [libcxx][WIP] Experimental support for a scheduler for use in the parallel stl algorithms
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 6 22:55:48 PDT 2017
erik.pilkington created this revision.
Herald added a reviewer: EricWF.
This patch adds a simple work-stealing scheduler meant for use as a fallback implementation for the C++17 parallel stl algorithms. This scheme follows a very simple fork/join API that should be easy to map onto different underlying concurrency implementations if they are available. This should be suitable for implementing par & par_unseq on top of.
I also tried this out with a lock-free deque[0]. This provides a modest performance improvement, and might be worth implementing. For the sake of doing this incrementally this patch just contains a locking deque.
Please see the recent thread on cfe-dev for context: http://lists.llvm.org/pipermail/cfe-dev/2017-May/053841.html
I'm still pretty new to libc++ and to parallel stuff, so please feel free to tear this patch apart!
Thanks for taking a look,
Erik
[0]: https://pdfs.semanticscholar.org/3771/77bb82105c35e6e26ebad1698a20688473bd.pdf
https://reviews.llvm.org/D33977
Files:
include/experimental/execution
src/experimental/execution.cpp
test/libcxx/experimental/execution/fork_join.pass.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33977.101668.patch
Type: text/x-patch
Size: 10759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170607/311db2b9/attachment-0001.bin>
More information about the cfe-commits
mailing list