質問編集履歴
2
flg_get, flg_put をそれぞれ Process の引数(args)で渡す。不要なグローバス変数の削除。
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
def DataPut(q):
|
35
|
+
def DataPut(q, flg_put):
|
36
36
|
|
37
37
|
global data
|
38
38
|
|
@@ -54,11 +54,9 @@
|
|
54
54
|
|
55
55
|
|
56
56
|
|
57
|
-
def DataGet(q):
|
57
|
+
def DataGet(q, flg_get):
|
58
58
|
|
59
|
-
global data_list
|
59
|
+
global data_list
|
60
|
-
|
61
|
-
|
62
60
|
|
63
61
|
while flg_get.value:
|
64
62
|
|
@@ -104,11 +102,11 @@
|
|
104
102
|
|
105
103
|
|
106
104
|
|
107
|
-
p1 = Process( target = DataPut, args=(q,) )
|
105
|
+
p1 = Process( target = DataPut, args=(q, flg_put) )
|
108
106
|
|
109
107
|
p1.start()
|
110
108
|
|
111
|
-
p2 = Process( target = DataGet, args=(q,) )
|
109
|
+
p2 = Process( target = DataGet, args=(q, flg_get) )
|
112
110
|
|
113
111
|
p2.start()
|
114
112
|
|
1
コードにミスがあった
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,7 +60,7 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
-
while flg_get.value
|
63
|
+
while flg_get.value:
|
64
64
|
|
65
65
|
|
66
66
|
|