(parallel) sorting pthreads

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SaraAlgmaty
    New Member
    • Apr 2010
    • 1

    #1

    (parallel) sorting pthreads

    hi all

    I would find a parallel sorting algorithms written with pthread
    programs, as a benchmark to run.

    Any pointing will be of help

    thankyou in advance
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Both mergesort and quicksort are easily made parallel.
    eg mergesort:
    new thread to sort on firsthalf
    new thread to sort on secondhalf
    wait for both threads to finish
    merge

    quick sort:
    sort on the pivot.
    call thread to quick sort on left part
    call thread to quick sort on right part.
    wait until both threads are done.

    Comment

    Working...