annotate memo.txt @ 13:f06fb0370caf

add pthread code that has not been debuged yet.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 08 Jan 2010 20:00:01 +0900
parents 803d6bf22e6d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 Task
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 o 一つ一つの仕事を表す
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 o それぞれが別のTaskに対して依存関係を持っている
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 o 一つのTaskは複数のコードセグメントの連なり
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 o コードセグメント毎にスケジューラに処理を渡したい
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 o gotoのリフレクションは今はマクロで?
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 * ユーザーインターフェイス
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 o wait_for (using set_depend of TM)
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 o set_cpu (optional)
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 o spawn
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 TaskManager
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 o 実行環境によらないおなじ処理
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 o Taskの依存関係をもとに実行に移す
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 o 実際の実行はSchedulerに任せる
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 o activeTaskQとwaitingTaskQをもつ
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 o SchedulerからTaskの終了通知を受け取る
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 o 通知を受けたらそのTaskに依存しているTaskの依存を解消
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 o 依存がなくなったタスクはactiveTaskQに移される
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 o 実行中のTaskがなく, activeTaskQが0なら終了?
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 * ユーザーインターフェイス
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 o malloc
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 o create_task
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 o ?set_depend (used by wait_for of Task)
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 o spawn_task (used by spawn of Task)
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
2
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
28 TaskScheduler
0
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 o TaskManagerに指示されたTaskを実際に実行する
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 o CPU管理
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 o Taskが終了したらTaskManagerに通知する
2
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
32 * AbstractLayerからのインターフェイス
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
33 o initScheduler()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
34 o addCode(SchedTask *)
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
35 o selectCode()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
36
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
37 AbstractLayer
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
38 o TaskManagerとSchedulerの中間レイヤ
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
39 o 実行環境ごとに全部違う Cell, Fifo, pthread, cluster..
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
40 o TaskManagerに指示されたタスクをSchedulerに渡す
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
41 o その際、clusterやCellならデータの転送処理などを受け持つ
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
42 o Schedulerから終了したタスクの通知も受け付ける
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
43 * Schedulerとのインタフェイス
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
44 -> checkNewCode()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
45 -> exitCode()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
46 <- initScheduler()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
47 <- addCode()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
48 <- selectCode()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
49 * TaskManagerとのインタフェイス
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
50 o checkAction()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
51 -> TM::addNewTask()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
52 -> TM::finishTask()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
53 -> TM::noAction()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
54 o executeTask(Task*)
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
55 -> TM::executeTaskret() // なんかいい名前を…
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
56 * Userインタフェイス(Fifoやpthreadの場合は直接TaskManagerでもいい)
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
57 o newTask()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
58 o spawn()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
59 o setData()
803d6bf22e6d second commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
60 o allocate()
0
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 MailManager
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 o Schedulerとおなじく環境依存
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 o TaskManagerに終了通知を行う
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66
5b089096921f first commit.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 ユーザはTaskのコードセグメントを定義すればいい