Mercurial > hg > Game > Cerium
view example/word_count_test/WordCount.h @ 839:1001c4bea1a0 draft
if unnecessary
author | Yutaka_Kinjyo |
---|---|
date | Fri, 28 May 2010 03:24:52 +0900 |
parents | 54f0180cea0f |
children |
line wrap: on
line source
#include "TaskManager.h" typedef struct wordCount { struct wordCount *self; int size; // remaining file size int division_size; // for each word count task int division_out_size; int out_size; int task_num; // remaining task count int task_blocks; // spawn task one at a time int status_num; int task_spwaned; unsigned long long *o_data; unsigned long long *head_tail_flag; int out_task_num; int pad; char * file_mmap; HTaskPtr t_print; int waiting; int pipeline_count; HTaskPtr *wait_list; } WordCount; static inline HTask * next_wait_task(WordCount *w, HTask *next) { w->waiting = (w->waiting+1)%w->pipeline_count; HTask *wait = w->wait_list[w->waiting]; w->wait_list[w->waiting] = next; return wait; } static inline void set_pipeline_count(WordCount *w, TaskManager *m, int p) { w->pipeline_count = p; w->wait_list = (HTaskPtr *)m->allocate(sizeof(HTaskPtr)*p); bzero(w->wait_list,sizeof(HTaskPtr)*p); }