annotate example/post_function/README @ 839:1001c4bea1a0 draft

if unnecessary
author Yutaka_Kinjyo
date Fri, 28 May 2010 03:24:52 +0900
parents 028ffc9c0375
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 /*
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 * $Id: README,v 1.2 2008/10/21 07:38:41 gongo Exp $
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 - 概要
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 基本的には HelloWorld と同じなんですが、
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 Hello Task が終了すると、set_post で指定した関数を呼び出すようにしています。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 この関数を使えば、タスクが終了した事が検知できる。きっと多分。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 引数は void* のみです。特に問題はないと信じてます。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 API
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 set_post(void (*func)(void*), void *arg);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 func の実装
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 func(void *p) {}
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 - 実行方法
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 % ./post [-cpu CPU_NUM] [-count COUNT]
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 -cpu 使用する SPU の数です。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 -count 表示する "Hello, World!!" の数。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 正確には post_func を使って繰り返し呼ぶ Hello Task の数。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 - 実行例
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 % ./post
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30 Hello, World!! post_func output 1
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 post function : 1
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 % ./post -count 10
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 Hello, World!! post_func output 10
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 post function : 10
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 Hello, World!! post_func output 9
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 post function : 9
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 Hello, World!! post_func output 8
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 post function : 8
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 Hello, World!! post_func output 7
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 post function : 7
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 Hello, World!! post_func output 6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 post function : 6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 Hello, World!! post_func output 5
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 post function : 5
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 Hello, World!! post_func output 4
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 post function : 4
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 Hello, World!! post_func output 3
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 post function : 3
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 Hello, World!! post_func output 2
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 post function : 2
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52 Hello, World!! post_func output 1
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 post function : 1