[concurrency-interest] Merging forked tasks - Repeating because of some formatting problem

Ramsundar Kandasamy kramasundar at yahoo.com
Tue Mar 16 06:55:14 EDT 2010


This mail is a duplicate copy of my previous mail. There was some formatting issues in my previous mail.


Hi

I don't know whether this is a open forum where one can post his questions. If you think that this a inappropriate message please discard it.

I am playing around with this ForkJoin framework. I was trying the first sample usage of RecursiveAction given in its javaDoc page.

class SortTask extends RecursiveAction {
   ....
   protected void compute() {
     if (hi - lo < THRESHOLD)
       sequentiallySort(array, lo, hi);
     else {
       int mid = (lo + hi) >>> 1;
       invokeAll(new SortTask(array, lo, mid), new SortTask(array, mid, hi));
       merge(array, lo, hi);  //!!!!! how to do this
     }
   }
 }

and following is my sequentiallySort method

 private void sequentiallySort(Integer[] array, int lo, int hi) {
        Arrays.sort(array, lo, hi + 1);
 }

but I don't know how should I design the merge(array, lo, hi) method?

any hints?

Thanks,
Ramsundar Kandasamy





      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20100316/5764af03/attachment.html>


More information about the Concurrency-interest mailing list