annotate TaskManager/kernel/ppe/Threads.h @ 1499:622a7d053537 draft

cpu id etc
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 22 Aug 2012 17:42:33 +0900
parents bd4a27ae2524
children e8c9a7099bcc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #ifndef INCLUDED_THREADS
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #define INCLUDED_THREADS
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include <pthread.h>
1179
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 899
diff changeset
5 #include "base.h"
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 899
diff changeset
6 #include "types.h"
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 class Threads {
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 public:
895
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
11 BASE_NEW_DELETE(Threads);
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
12
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 /* constructor */
824
a75ccd570a57 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
14 Threads(int num = 1) {};
a75ccd570a57 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
15 virtual ~Threads() {};
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 /* functions */
1191
bd4a27ae2524 success run to ballbound
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
18 virtual void init() = 0;
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING
1499
622a7d053537 cpu id etc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1191
diff changeset
22 virtual void add_output_tasklist(int command, memaddr buff, int alloc_size) = 0;
622a7d053537 cpu id etc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1191
diff changeset
23 virtual int is_gpu(int cpuid) { return 0; }
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 /* variables */
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 pthread_t *threads;
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 int cpu_num;
899
1b9418af3127 minor fix..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
28 } ;
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 #endif