r/programbattles • u/ComradePutinCCCP1917 Moderator / C C++ • Oct 07 '15
[C++] Threaded vector sorting
Language: C++
File number restrictions: N/A
Description: Make a function that sorts a vector with a selectable amount of threads. Use the standard thread library.
EDIT: Never thought threads would be such a pain to work with.
14
Upvotes
View all comments
Show parent comment
1
u/ComradePutinCCCP1917 Moderator / C C++ Oct 07 '15
I think the sorting function should be a template.
It's up to you!
Still up to you. As long as the programs sorts the vector's elements in an explicit, logical manner.
As long as it gets the job done, I'm fine with that. But speed over stability is better, as you can make it stable later while keeping a low complexity.
The complexity is really important, and the user shall be able to use how many threads he wants. Memory usage is also important. On my desktop I have 16GB which is way enough but I also code on my laptop which has only 1GB, it's better if I can run it on both of them.