# HG changeset patch # User gongo # Date 1203302411 -32400 # Node ID 5a1a5f4c28fdbc74cd94d91c9a2b384add357b69 # Parent db2b7c565b8933c56416ae507afd7ae035beb358 *** empty log message *** diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Cell/CellTaskManagerImpl.cc --- 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; diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Cell/SpeThreads.cc --- 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); } diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Makefile.cell --- 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) diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Makefile.def --- 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 diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Test/simple_render/Makefile --- 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: diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Test/simple_render/spe/Makefile --- 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 diff -r db2b7c565b89 -r 5a1a5f4c28fd TaskManager/Test/simple_render/viewer.cpp --- 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(); } diff -r db2b7c565b89 -r 5a1a5f4c28fd include/TaskManager/SpeThreads.h --- a/include/TaskManager/SpeThreads.h Mon Feb 18 04:47:28 2008 +0900 +++ b/include/TaskManager/SpeThreads.h Mon Feb 18 11:40:11 2008 +0900 @@ -15,6 +15,7 @@ public: /* constructor */ SpeThreads(int num = 1); + ~SpeThreads(void); /* functions */ void init(void);