Mercurial > hg > Game > Cerium
changeset 76:5a1a5f4c28fd
*** empty log message ***
author | gongo |
---|---|
date | Mon, 18 Feb 2008 11:40:11 +0900 |
parents | db2b7c565b89 |
children | 459f54b49648 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/SpeThreads.cc TaskManager/Makefile.cell TaskManager/Makefile.def TaskManager/Test/simple_render/Makefile TaskManager/Test/simple_render/spe/Makefile TaskManager/Test/simple_render/viewer.cpp include/TaskManager/SpeThreads.h |
diffstat | 8 files changed, 58 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Mon Feb 18 11:40:11 2008 +0900 @@ -108,12 +108,15 @@ } } } - } while (list == NULL && !bufferManager->activeTaskQueue); + } while (list == NULL && bufferManager->waitTaskQueue + && !bufferManager->activeTaskQueue); if (list == NULL) { next_list = set_task(); - d = mailManager->create((unsigned int)next_list); - list = MailManager::append_mailQueue(list, d); + if (next_list != NULL) { + d = mailManager->create((unsigned int)next_list); + list = MailManager::append_mailQueue(list, d); + } } return list;
--- a/TaskManager/Cell/SpeThreads.cc Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Mon Feb 18 11:40:11 2008 +0900 @@ -1,7 +1,39 @@ +#include "types.h" #include "SpeThreads.h" SpeThreads::SpeThreads(int num) : spe_num(num) {} +SpeThreads::~SpeThreads(void) +{ + unsigned int mail = MY_SPE_COMMAND_EXIT; + int ret; + + for (int i = 0; i < spe_num; i++) { + send_mail(i, &mail); + } + + printf("****** SpeThreads 1 ********\n"); + + for (int i = 0; i < spe_num; i++) { + pthread_join(threads[i], NULL); + ret = spe_context_destroy(spe_ctx[i]); + if (ret) { + perror("[~SpeThreads] spe_context_destroy"); + } + } + + printf("****** SpeThreads 2 ********\n"); + + spe_image_close(spe_handle); + + delete [] spe_ctx; + delete [] threads; + delete [] args; + + + printf("****** SpeThreads 3 ********\n"); +} + void* SpeThreads::spe_thread_run(void *arg) { @@ -21,6 +53,9 @@ pthread_create(&thread, NULL, &spe_thread_run, (void*)arg_t->ctx); + // mail read の blocking ができれば + // ここで呼んだ方が早い。 + pthread_exit(NULL); }
--- a/TaskManager/Makefile.cell Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Makefile.cell Mon Feb 18 11:40:11 2008 +0900 @@ -10,6 +10,8 @@ EXTRA_CFLAGS = -fno-strict-aliasing +TARGET = libCellManager.a + all: default default: $(TARGET) $(SPETARGET)
--- a/TaskManager/Makefile.def Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Makefile.def Mon Feb 18 11:40:11 2008 +0900 @@ -24,7 +24,7 @@ IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cpp=.o) CC = g++ -CFLAGS = -Wall -g -D_PPE_DEBUG# -DDEBUG +CFLAGS = -O9 -Wall -g -D_PPE_DEBUG# -DDEBUG LIBS = INCLUDE = -I../include/TaskManager \ No newline at end of file
--- a/TaskManager/Test/simple_render/Makefile Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Test/simple_render/Makefile Mon Feb 18 11:40:11 2008 +0900 @@ -8,15 +8,16 @@ TASK_OBJS = $(TASK_SRCS:.cpp=.o) CC = g++ -CFLAGS = -g -Wall# -DDEBUG +CFLAGS = -O9 -g -Wall# -DDEBUG INCLUDE = -I../../../include/TaskManager -I. EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags`\ +#EXTRA_LIBS = -lCellManager -lspe2 -lpthread +EXTRA_LIBS = -lFifoManager + LIBS = `sdl-config --libs` -lSDL_image -lGL \ - `xml2-config --libs`\ - -L../../ -lmanager -lspe2 -lpthread - + `xml2-config --libs` -L../.. $(EXTRA_LIBS) .SUFFIXES: .cpp .o .cpp.o:
--- a/TaskManager/Test/simple_render/spe/Makefile Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/Makefile Mon Feb 18 11:40:11 2008 +0900 @@ -4,7 +4,7 @@ OBJS = $(SRCS:.cpp=.o) CC = spu-g++ -CFLAGS = #-g -Wall# -DDEBUG +CFLAGS = #-O9 #-g -Wall# -DDEBUG INCLUDE = -I../../../../include/TaskManager -I. -I.. LIBS = -L../../.. -lspemanager
--- a/TaskManager/Test/simple_render/viewer.cpp Mon Feb 18 04:47:28 2008 +0900 +++ b/TaskManager/Test/simple_render/viewer.cpp Mon Feb 18 11:40:11 2008 +0900 @@ -285,7 +285,11 @@ HTaskPtr task; int fd; - if (quit_check()) { + bool quit_flg; + + quit_flg = quit_check(); + + if (quit_flg == true) { this_time = get_ticks(); fd_finish = manager->open("ViewerRunFinish"); task_finish = manager->create_task(fd_finish, 0, 0, 0, NULL); @@ -354,8 +358,8 @@ delete [] pixels; polygon->delete_data(); delete polygon; - delete sgp_buff; - delete pp_buff; + //delete sgp_buff; + //delete pp_buff; quit(); }