annotate queue.h @ 0:d4bc23cb728b

Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Wed, 16 Dec 2015 15:16:11 +0900
parents
children b15128ab0324
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /*
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 OS Scheduler Simulator
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ** 連絡先: 琉球大学情報工学科 河野 真治
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp)
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 **
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ** このソースのいかなる複写,改変,修正も許諾します。ただし、
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ** その際には、誰が貢献したを示すこの部分を残すこと。
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ** 再配布や雑誌の付録などの問い合わせも必要ありません。
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ** 営利利用も上記に反しない範囲で許可します。
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ** バイナリの配布の際にはversion messageを保存することを条件とします。
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ** このプログラムについては特に何の保証もしない、悪しからず。
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 **
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ** Everyone is permitted to do anything on this program
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ** including copying, modifying, improving,
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ** as long as you don't try to pretend that you wrote it.
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ** i.e., the above copyright notice has to appear in all copies.
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ** Binary distribution requires original version messages.
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 ** You don't have to ask before copying, redistribution or publishing.
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 Task Queue Manager
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 ** modify: Atsuki Shimoji(atsuki@cr.ie.u-ryukyu.ac.jp)
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 */
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #ifndef _QUEUE_H_
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #define _QUEUE_H_
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #include "dpp_common.h"
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 #include "state_db.h"
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 typedef struct task {
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 struct task *next;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 struct phils *phils;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 } Task, *TaskPtr;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 typedef struct task_iterator {
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 struct task_iterator *prev;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 StateDB state;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 TaskPtr list;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 TaskPtr last;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 } TaskIterator, *TaskIteratorPtr;
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 extern TaskIteratorPtr
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 create_task_iterator(TaskPtr list,struct state *s,TaskIteratorPtr prev);
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 extern TaskPtr
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 next_task_iterator(TaskIteratorPtr self);
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 extern void
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 free_task_iterator(TaskIteratorPtr iter);
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 extern
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 code create_queue(int count, PhilsPtr self, TaskPtr list, TaskPtr last,
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 code (*dest)(
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 int count,PhilsPtr self, TaskPtr list,TaskPtr last, TaskPtr q
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 ));
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 extern
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 code enqueue(int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 code (*dest)(
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 ));
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 extern void free_queue(TaskPtr q);
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 extern code dequeue(code (*dest)(), TaskPtr list, TaskPtr *q);
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
d4bc23cb728b Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 #endif