Mercurial > hg > Game > Cerium
diff TaskManager/Cell/SpeThreads.cc @ 806:fb49e881f2ed draft
TaslListInfo
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 May 2010 18:20:16 +0900 |
parents | 1b225972ae88 |
children | a75ccd570a57 |
line wrap: on
line diff
--- a/TaskManager/Cell/SpeThreads.cc Fri May 21 07:47:25 2010 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Sat May 22 18:20:16 2010 +0900 @@ -3,18 +3,18 @@ #include "SpeThreads.h" #include "Scheduler.h" -SpeThreads::SpeThreads(int num) : spe_num(num) {} +SpeThreads::SpeThreads(int num) : cpu_num(num) {} SpeThreads::~SpeThreads(void) { memaddr mail = (memaddr)MY_SPE_COMMAND_EXIT; int ret; - for (int i = 0; i < spe_num; i++) { + for (int i = 0; i < cpu_num; i++) { send_mail(i, 1, &mail); } - for (int i = 0; i < spe_num; i++) { + for (int i = 0; i < cpu_num; i++) { pthread_join(threads[i], NULL); ret = spe_context_destroy(spe_ctx[i]); if (ret) { @@ -85,18 +85,18 @@ exit(EXIT_FAILURE); } - spe_ctx = new spe_context_ptr_t[spe_num]; - threads = new pthread_t[spe_num]; - args = new thread_arg_t[spe_num]; + spe_ctx = new spe_context_ptr_t[cpu_num]; + threads = new pthread_t[cpu_num]; + args = new thread_arg_t[cpu_num]; - for (int i = 0; i < spe_num; i++) { + for (int i = 0; i < cpu_num; i++) { args[i].speid = i; spe_ctx[i] = spe_context_create(0, NULL); spe_program_load(spe_ctx[i], spe_handle); args[i].ctx = spe_ctx[i]; } - for (int i = 0; i < spe_num; i++) { + for (int i = 0; i < cpu_num; i++) { pthread_create(&threads[i], NULL, &spe_thread_run, (void*)&args[i]); }