comparison example/many_task/sort.cc @ 936:14fb1c888931

dead lock on spu/ppu mail
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 31 Jul 2010 05:31:12 +0900
parents e54842e4d97b
children 8733ad41297d
comparison
equal deleted inserted replaced
935:e54842e4d97b 936:14fb1c888931
72 72
73 int last_block_num = data_length - (split_num-1)*block_num; 73 int last_block_num = data_length - (split_num-1)*block_num;
74 int last_half_block_num = half_block_num+(last_block_num/2); 74 int last_half_block_num = half_block_num+(last_block_num/2);
75 75
76 if (--sort_count < 0) { 76 if (--sort_count < 0) {
77 check_data();
78 return; 77 return;
79 } 78 }
80 79
81 80
82 for (int i = 0; i < split_num-1; i++) { 81 for (int i = 0; i < split_num-1; i++) {
153 int last_block_num = data_length - (split_num-1)*block_num; 152 int last_block_num = data_length - (split_num-1)*block_num;
154 int last_half_block_num = half_block_num+(last_block_num/2); 153 int last_half_block_num = half_block_num+(last_block_num/2);
155 154
156 155
157 if (--sort_count < 0) { 156 if (--sort_count < 0) {
158 check_data();
159 return; 157 return;
160 } 158 }
161 159
162 160
163 for (int i = 0; i < split_num-1; i++) { 161 for (int i = 0; i < split_num-1; i++) {
218 bsort[i]->wait_for(fsort[i+1]); 216 bsort[i]->wait_for(fsort[i+1]);
219 bsort[i]->spawn(); 217 bsort[i]->spawn();
220 } 218 }
221 } 219 }
222 220
223 HTask restart = create_task(RESTART,0,0,0,0); 221 HTask *restart = manager->create_task(RESTART,0,0,0,0);
224 for (int i = 0; i < split_num; i++) { 222 for (int i = 0; i < split_num; i++) {
225 if (!all) restart->wait_for(fsort[i]); 223 if (!all) restart->wait_for(fsort[i]);
226 fsort[i]->spawn(); 224 fsort[i]->spawn();
227 } 225 }
228 restart->spawn(); 226 restart->spawn();