{"action":"opened","issue":{"url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/22","labels_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/22/comments","events_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/22/events","html_url":"https://github.com/Morwenn/cpp-sort/issues/22","id":115931932,"number":22,"title":"Parallel sorting algorithms","user":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Morwenn/cpp-sort/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Morwenn/cpp-sort/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-09T18:02:30Z","updated_at":"2015-11-09T18:02:30Z","closed_at":null,"body":"At the time of writing, all of the sorting algorithms provided by **cpp-sort** are sequential. Having parallel sorting algorithms too would be great, but *how* do we want to implement them? No definitive design but several ideas:\r\n* The simplest way would be to make a parallel sorter \"just another sorter\". The documentation would tell that it can work in parallel but with no associated semantics from the library.\r\n* The sorters could take execution policy parameters as the ones proposed in the [Parallelism TS](http://en.cppreference.com/w/cpp/experimental/parallelism). Moreover, it may allow them [to benefit from executors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4406.pdf) in the future if this design makes it to the standard library.\r\n* While it may introduce yet another layer of complexity and maybe some additional SFINAE, the proposed trait `std::is_execution_policy` should ease the implementation a bit.\r\n* Some sorters such as `merge_sorter` or `std_sorter` would probably keep the same name and provide both sequential and parallel versions of the algorithm. Other sorters will probably be parallel-only and implement some specific sorting algorithms.\r\n\r\nAnnnnnnd, once again, many design questions that won't have an answer right now. Anyway, these algorithms probably won't see the light before the parallelism TS is widely supported. To be honest, the work probably won't start before C++17 is out."}}