I would like to speed up a sorting function by implementing threads to work in parallel. My basic knowledge of pthreads are create, join, and using mutexes to prevent a deadlock.
So my questions are: How do I assign a task to a thread after it it finishes a task? For example, if I were to give half of a list to thread 1 to sort and the other to task 2 to sort, Once task 1 finishes, it should jump over to task two and help it.
If it helps, I'm testing with quick sort.
I've tried to see if there a task assigning function but the ones I stumble upon are in different codes.