Mercurial > hg > Game > Atoc
annotate driver/process_list.c @ 1:b4285b887e18 default tip
add document
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Sep 2009 17:33:34 +0900 |
parents | 42f240cc4bc6 |
children |
rev | line source |
---|---|
0
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 * process_list.c |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 * SPE プロセスマネージャ spe_manager |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 * プロセスリストとそれを扱うインライン関数など |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 #include <linux/module.h> // カーネルモジュール全般 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 #include "../include/spe_process.h" |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 #include "process_list.h" |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 #include "lspe.h" |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 // プロセスの各状態ごとの番兵ノード |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 //static spe_process_context_list_t sentry_opened; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 //static spe_process_context_list_t sentry_written; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 static spe_process_context_list_t sentry_waiting; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 //static spe_process_context_list_t sentry_not_released; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 // 各論理 SPE が実行しているプロセスのコンテキスト |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 static spe_process_context_list_t *running_process[SPE_COUNT_MAX]; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 // プロセスの各状態ごとのプロセス数 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 // (running はその都度 running_process を確かめるので不要) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 static int count_opened = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 static int count_written = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 static int count_waiting = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 static int count_not_released = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 static int count_released = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 //=========================================================================================== initialize_process_lists() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 * initialize_process_lists |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 * プロセスリストの初期化 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 void initialize_process_lists(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 int i, lspe_count = get_lspe_count(); |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 // 番兵初期化 (自分自身を指しておく) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 // sentry_opened.prev_process = sentry_opened.next_process = &sentry_opened; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 // sentry_written.prev_process = sentry_written.next_process = &sentry_written; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 sentry_waiting.prev_process = sentry_waiting.next_process = &sentry_waiting; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 // sentry_not_released.prev_process = sentry_not_released.next_process = &sentry_not_released; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 // 各論理 SPE の実行プロセスポインタを初期化 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 for (i = 0; i < lspe_count; i++) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 clear_running_process(i); |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 //=================================================================================================== increment_opened() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 * increment_opened |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 * OPENED 状態のプロセス数を 1 加算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 void increment_opened(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 count_opened++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 //=================================================================================================== decrement_opened() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 * decrement_opened |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 * OPENED 状態のプロセス数を 1 減算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 void decrement_opened(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 count_opened--; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 //================================================================================================== increment_written() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 * increment_written |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 * WRITTEN 状態のプロセス数を 1 加算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 void increment_written(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 count_written++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 //================================================================================================== decrement_written() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 * decrement_written |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 * WRITTEN 状態のプロセス数を 1 減算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 void decrement_written(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 count_written--; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 //============================================================================================= add_process_to_waiting() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 * add_process_to_waiting |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 * WAITING 状態のプロセスリストに SPE プロセスを加える |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 * Note: これと同時に count_waiting が 1 加算される。 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 void add_process_to_waiting(spe_process_context_list_t *this_process) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 // リスト更新 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 this_process->prev_process = sentry_waiting.prev_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 this_process->next_process = &sentry_waiting; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 sentry_waiting.prev_process->next_process = this_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 sentry_waiting.prev_process = this_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 // プロセス数加算 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 count_waiting++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 //=========================================================================================== get_next_waiting_process() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 * get_next_waiting_process |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 * WAITING 状態のプロセスリストの先頭にあるプロセスを取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 * Note: WAITING 状態のプロセスがない場合は NULL になる。 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 * Note: WAITING 状態のプロセスを返すだけで、他の処理は何も行わない。 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 * 適宜 remove_process_from_waiting 関数などを実行すること。 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 * @return spe_process_context_list_t * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 spe_process_context_list_t *get_next_waiting_process(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 spe_process_context_list_t *next_process = sentry_waiting.next_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 return (next_process == &sentry_waiting) ? NULL : next_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 //======================================================================================== remove_process_from_waiting() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 * remove_process_from_waiting |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 * WAITING 状態のプロセスリストから SPE プロセスを取り除く |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 * Note: これと同時に count_waiting が 1 減算される。 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 void remove_process_from_waiting(spe_process_context_list_t *this_process) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 // リスト更新 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 this_process->prev_process->next_process = this_process->next_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 this_process->next_process->prev_process = this_process->prev_process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 // プロセス数減算 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 count_waiting--; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 //================================================================================================ get_running_process() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 * get_running_process |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 * 論理 SPE が現在実行しているプロセスのコンテキストを取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 * @param int n SPE 番号 (0..x) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 * @return spe_process_context_list_t * 実行中プロセスコンテキストへのポインタ (実行していない場合は NULL) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 spe_process_context_list_t *get_running_process(const int n) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 return running_process[n]; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 //================================================================================================ set_running_process() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 * set_running_process |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 * 論理 SPE が現在実行しているプロセスのコンテキストを設定する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 * @param int n SPE 番号 (0..x) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 * @param spe_process_context_list_t *process プロセスコンテキストへのポインタ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 void set_running_process(const int n, const spe_process_context_list_t *const process) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 running_process[n] = process; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 //============================================================================================== clear_running_process() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 * clear_running_process |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 * 論理 SPE が現在実行しているプロセスを初期化する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 * @param int n SPE 番号 (0..x) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 void clear_running_process(const int n) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 running_process[n] = NULL; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 //============================================================================================= increment_not_released() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 * increment_not_released |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 * NOT_RELEASED 状態のプロセス数を 1 加算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 void increment_not_released(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 count_not_released++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 //============================================================================================= decrement_not_released() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 * decrement_not_released |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 * NOT_RELEASED 状態のプロセス数を 1 減算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 void decrement_not_released(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 count_not_released--; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 //================================================================================================= increment_released() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
247 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 * increment_released |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 * RELEASED 状態のプロセス数を 1 加算する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 * @return void |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 void increment_released(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 count_released++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
261 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
262 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
263 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
264 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
265 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
266 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
267 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
268 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
269 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 //=========================================================================================== get_process_count_opened() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 * get_process_count_opened |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 * OPENED 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
281 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 int get_process_count_opened(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 return count_opened; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 //========================================================================================== get_process_count_written() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 * get_process_count_written |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 * WRITTEN 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 int get_process_count_written(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 return count_written; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 //========================================================================================== get_process_count_waiting() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 * get_process_count_waiting |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 * WAITING 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 int get_process_count_waiting(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 return count_waiting; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 //========================================================================================== get_process_count_running() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 * get_process_count_running |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 * RUNNING 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
318 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 int get_process_count_running(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
322 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 int i, lspe_count = get_lspe_count(), ret = 0; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 for (i = 0; i < lspe_count; i++) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 if (running_process[i] != NULL) ret++; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
327 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 return ret; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332 //===================================================================================== get_process_count_not_released() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 * get_process_count_not_released |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
335 * NOT_RELEASED 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
337 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 int get_process_count_not_released(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 return count_not_released; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 } |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 //========================================================================================= get_process_count_released() |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 /** |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 * get_process_count_released |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 * RELEASED 状態のプロセス数を取得する |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 * |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 * @return int |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 */ |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 int get_process_count_released(void) |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 { |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 return count_released; |
42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 } |