Mercurial > hg > Game > Cerium
changeset 954:774eba654643 draft
auto_free
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 03 Aug 2010 15:32:49 +0900 |
parents | e16b5f1d55bc |
children | 6ffeb543e8d4 |
files | TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/HTask.h example/many_task/sort.cc |
diffstat | 3 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc Mon Aug 02 22:16:48 2010 +0900 +++ b/TaskManager/kernel/ppe/HTask.cc Tue Aug 03 15:32:49 2010 +0900 @@ -122,4 +122,5 @@ + /* end */
--- a/TaskManager/kernel/ppe/HTask.h Mon Aug 02 22:16:48 2010 +0900 +++ b/TaskManager/kernel/ppe/HTask.h Tue Aug 03 15:32:49 2010 +0900 @@ -110,6 +110,9 @@ void no_auto_free() { flag.no_auto_free = 1; } + void auto_free() { + flag.no_auto_free = 0; + } void init(int cmd) { next = prev = NULL;
--- a/example/many_task/sort.cc Mon Aug 02 22:16:48 2010 +0900 +++ b/example/many_task/sort.cc Tue Aug 03 15:32:49 2010 +0900 @@ -117,6 +117,14 @@ for (int i = 0; i < s->split_num; i++) { s->fsort[i]->spawn(); } + if (sort_count == 1) { + // last loop wait for all task + // we should not need this? + for (int i = 0; i < half_num; i++) { + restart->wait_for(s->bsort[i]); + s->bsort[i]->auto_free(); + } + } restart->spawn(); return 0; }