Hmm. You call qsort(). So do I take this to mean you want to have two threads each quicksort half of the array, then merge the two together? I'm doubtful of the point in this unless you have multiple processors and your system will arrange for each thread to run on one of them.
Well, I think the way to do this would be to load half of the file into one array and half into another, then have your threads each take one and qsort() it, then wait for the threads to end (with pthread_join() if my memory serves me intermittently, but don't trust me on this). Then the main program could do the merge into one big array.
I hope this answer belongs more to the solution set than the problem set.
