comparison example/many_task/sort.cc @ 954:774eba654643 draft

auto_free
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 03 Aug 2010 15:32:49 +0900
parents 9ed1c4a877ca
children b3644b73d2cf
comparison
equal deleted inserted replaced
953:e16b5f1d55bc 954:774eba654643
115 restart->set_param(0,(memaddr)s); 115 restart->set_param(0,(memaddr)s);
116 if (!all) restart->wait_for(s->fsort[0]); 116 if (!all) restart->wait_for(s->fsort[0]);
117 for (int i = 0; i < s->split_num; i++) { 117 for (int i = 0; i < s->split_num; i++) {
118 s->fsort[i]->spawn(); 118 s->fsort[i]->spawn();
119 } 119 }
120 if (sort_count == 1) {
121 // last loop wait for all task
122 // we should not need this?
123 for (int i = 0; i < half_num; i++) {
124 restart->wait_for(s->bsort[i]);
125 s->bsort[i]->auto_free();
126 }
127 }
120 restart->spawn(); 128 restart->spawn();
121 return 0; 129 return 0;
122 } 130 }
123 131
124 132