Mercurial > hg > Members > kono > Cerium
view TaskManager/Cell/SpeThreads.h @ 540:c5a411c19e7e
merge
author | tkaito@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 21 Oct 2009 20:02:23 +0900 |
parents | 09f33c51a204 |
children | 7a41d2cb0a84 |
line wrap: on
line source
#ifndef INCLUDED_SPE_THREADS #define INCLUDED_SPE_THREADS #include <libspe2.h> #include <pthread.h> #define SPE_ELF "spe-main" typedef struct arg { int speid; spe_context_ptr_t ctx; } thread_arg_t; class SpeThreads { public: /* constructor */ SpeThreads(int num = 1); ~SpeThreads(void); /* functions */ void init(void); int get_mail(int speid, int count, unsigned int* ret); // BLOCKING int check_mail(int speid, int count, unsigned int* ret); // NONBLOCK void send_mail(int speid, int num, unsigned int *data); // BLOCKING static void *spe_thread_run(void *arg); static void *frontend_thread_run(void *arg); void add_output_tasklist(int command, unsigned int buff, int alloc_size); private: /* variables */ spe_program_handle_t *spe_handle; spe_context_ptr_t *spe_ctx; pthread_t *threads; thread_arg_t *args; int spe_num; }; #endif