| Model Name | mutex_L_N1 |
| Description | Mutual exclusion with nonatomic operations by Lamport. Algorithm mutex_L_N1 is not even livelock-free. |
| Source Code | mutex_L_N1.pml |
| 出典 | James H. Anderson and Yong-jik Kim. Shared-memory mutual exclusion: Major research trends since (1986). Distributed Computing, pages 75-110, 2003. |
shared variable
P: array[0..N - 1] of boolean initially false
process p /* 0 <= p < N */
private variable
i: 0..N - 1;
S: set of 0..N - 1
while true do
1: Noncritical Section;
2: P[p] := true;
3: S := {q | 0 <= q < N ∧ q != p};
4: while S != 0 do
5: i := elementOf(S); S := S \ {i};
6: await ¬P[i]
od;
7: Critical Section;
8: P[p] := false
od
| N | プロセス数 |
| 名前 | Source Code | 性質(LTL記述) | 説明 |
| safety1 | mutex_L_N1.safe1 | collision | クリティカルセクションに複数のプロセスが侵入してしまう. |
| liveness1 | mutex_L_N1.live1 | ! ([] (wait -> <> (cs))) | プロセスがwait状態にあるならば、いつかクリティカルセクションに入る. |
| liveness2 | mutex_L_N1.live2 | ! ([] ( (! cs) -> <> cs)) | クリティカルセクションにいないプロセスは、いつかクリティカルセクションに入ることができる. |
| liveness3 | mutex_L_N1.live3 | ! ([] <> someoneincs) | いつか、あるプロセスがクリティカルセクションに入る. |
$ spin -a -DN=5 -N mutex_L_N1.safe1 mutex_L_N1.pml $ gcc -o pan pan.c $ ./pan
$ spin -a -DN=6 -N mutex_L_N1.live2 mutex_L_N1.pml $ gcc -o pan pan.c $ ./pan -a
最終更新日:2008/08/24