Mercurial > hg > Game > Cerium
comparison example/task_queue/ppe/Hello.cc @ 961:efee36d2f84c draft
fix QueueInfo
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 04 Aug 2010 23:05:59 +0900 |
parents | 94d82f2c842f |
children |
comparison
equal
deleted
inserted
replaced
960:418939c6837d | 961:efee36d2f84c |
---|---|
16 QueuePtr q = (QueuePtr) smanager->get_param(1); | 16 QueuePtr q = (QueuePtr) smanager->get_param(1); |
17 | 17 |
18 smanager->printf("[%d] Hello, World!!\n", task_id); | 18 smanager->printf("[%d] Hello, World!!\n", task_id); |
19 | 19 |
20 for(int i=0;i<100;i++) { | 20 for(int i=0;i<100;i++) { |
21 TaskQueueInfo *i0 = q->q[i%MAX_QUEUE]; | 21 QueueInfo<TaskQueue> *i0 = q->q[i%MAX_QUEUE]; |
22 TaskQueueInfo *i1 = q->q[(i+1)%MAX_QUEUE]; | 22 QueueInfo<TaskQueue> *i1 = q->q[(i+1)%MAX_QUEUE]; |
23 TaskQueue *q0; | 23 TaskQueue *q0; |
24 TaskQueue *q1; | 24 TaskQueue *q1; |
25 | 25 |
26 switch(q->m->get_random() % 4) { | 26 switch(q->m->get_random() % 4) { |
27 case 0: | 27 case 0: |
28 q0 = i0->create(0); | 28 q0 = i0->create(); i0->init(0); |
29 q1 = i1->create(0); | 29 q1 = i1->create(); i1->init(0); |
30 i1->addLast(q0); | 30 i1->addLast(q0); |
31 i0->addLast(q1); | 31 i0->addLast(q1); |
32 break; | 32 break; |
33 case 1: | 33 case 1: |
34 if (TaskQueue *p = i0->poll()) { | 34 if (TaskQueue *p = i0->poll()) { |