Mercurial > hg > Game > Cerium
changeset 1758:141174033f1a draft
fix to keep list
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Nov 2013 13:56:37 +0900 |
parents | feba52cd8374 |
children | 06fc317e17a3 b53d197ec03d |
files | TaskManager/kernel/schedule/SchedTask.cc TaskManager/test/UtilizationTest/multiply |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/SchedTask.cc Fri Nov 22 13:24:10 2013 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Fri Nov 22 13:56:37 2013 +0900 @@ -33,8 +33,9 @@ void SchedTask::init(TaskListPtr _list, TaskPtr _task, Scheduler* sc, int tag) -{ - list = _list; +{ + // do not modify these, all shared among read/exec/write pipeline + list = _list; atask = _task; scheduler = sc; this->tag = tag; @@ -182,14 +183,15 @@ SchedTaskBase* SchedTask::next(Scheduler *scheduler, SchedTaskBase *p) { + TaskList *nextList = list; // do not modify list __debug("[SchedTask:%s]\n", __FUNCTION__); if (cur_index == 0) { // 最初の一つ - while (list && !list->dim && list->cpu != scheduler->id) - list=list->next; - if (list == 0) return new SchedNop2Ready(scheduler); + while (nextList && !nextList->dim && nextList->cpu != scheduler->id) + nextList=nextList->next; // avoid duplicate sent task + if (nextList == 0) return new SchedNop2Ready(scheduler); SchedTask *nextSched = new SchedTask(); - nextSched->init(list, &list->tasks[0], scheduler, this->tag^1); + nextSched->init(nextList, &nextList->tasks[0], scheduler, this->tag^1); return nextSched; } TaskPtr nextTask = cur_index->next(); // ここで一個一個のtaskを取ってきてる @@ -202,18 +204,16 @@ nextSched->init(list, nextTask, scheduler, this->tag^1); return nextSched; } else { - list = list->next; - while (list && !list->dim && list->cpu != scheduler->id) - list=list->next; - memaddr nextList = (memaddr)list; + nextList = list->next; + while (nextList && !nextList->dim && nextList->cpu != scheduler->id) + nextList=nextList->next; if (nextList == 0) { // もう何もする必要がない - return new SchedNop2Ready(scheduler); } else { // 新しいリストに取り掛かる int dma_tag_switch = 0; - return new SchedTaskList(nextList, scheduler, dma_tag_switch); + return new SchedTaskList((memaddr)nextList, scheduler, dma_tag_switch); } } }