简体   繁体   中英

C++ Multithreading - algorithm alternative of merge sort with threads

I have written a merge sort algorithm that sort array with integer data.

Now I need to write another sorting algorithm again with multithread concepts -phthread, which again sorting array with integer data.

My task background: I have 2 child processes which sorting(with different algorithms) one integer array and first completed task print result and parent kill another process. I had done everything just need to implement 2nd algorithm logic

Please tell me which algorithm I have to use and give me an example implementation

Thank you in advance

One portable option is to use Intel Parallel STL . It is compatible with C++11 and implements parallel std::sort .

C++17 parallel algorithms in GNU C++ standard library and gcc-9 delegate to Intel Parallel STL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM