My client wanted their apps synced, and I made it with GoToru Furukawa
?
The document discusses using Go to run simulation apps in parallel while keeping them synchronized. It describes using shared memory and message passing between processes to delegate simulation work to DLLs and coordinate their execution. Key points include spawning goroutines to handle requests concurrently, suspending tasks if not ready, and flushing suspended tasks when conditions are ready to proceed in parallel while staying synchronized. The goal is to leverage Go's concurrency features to efficiently run multiple simulation objects in parallel instead of serially while maintaining sync between processes.
44. cons 関数 リストは cons セルで構成されている。
(X?Y) (X?.?Y)
セルの左側を car
セルの右側を cdr
と呼ぶ。長大な薀蓄を聞きたいのでなけれ
ば、なんで left, right とかじゃないのかと
X Y X Y いう質問はしないこと。
(cons?1?'(a?b))
cons 関数は新しい cons セルを用意して、第一引
数を car 部に第二引数を cdr 部にセットする。
これを繰り返せば、どんな複雑なリストの構造も作
成できる。
1 まぁ実際は cons だけでは面倒くさいので色々と便
利関数は用意されている
リストのあれこれ tips については後日っす。
a b
45. cons をもう少し
L1 L2
X Y 1 2
(cons?l1?(cons?l2?nil)) → ((x?y)?(1?2))
X Y 1 2
46. setf をリストに使うときの注意
● リストに対して setf してみると…
CL?USER>?(defvar?lst?'(a?b?c))
CL?USER>?(setf?(cdr?lst)?'(1?2))
CL?USER>?lst
● 上の結果はどうなるか?
lst
A B C
1 2
47. setf をリストに使う時の注意
● 新しいセル作らずに無理やりポインタ書換え!
CL?USER>?(defvar?lst?'(a?b?c))
CL?USER>?(setf?(cdr?lst)?'(1?2))
CL?USER>?lst
lst
(cdr?lst) の位置
を強制的に書換えた!
A B C
これらのオブジェクトはもう参照
できない!いずれ GC の餌食にな
る
1 2