Mercurial > hg > Members > nobuyasu > Spin
comparison promela/alt2.pml @ 0:86e67be8bc5f draft
add some files
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 29 Jun 2012 01:14:43 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:86e67be8bc5f |
---|---|
1 // Multiple Process to run alternately | |
2 | |
3 mtype = { F, S}; | |
4 mtype turn = F; | |
5 | |
6 active [2] proctype Producer() | |
7 { | |
8 do | |
9 :: (turn == F) -> printf("Producer-%d\n",_pid); turn = S; | |
10 od | |
11 } | |
12 | |
13 active [2] proctype Consumer() | |
14 { | |
15 do | |
16 :: (turn == S) -> printf("Consumer-%d\n",_pid); turn = F; | |
17 od | |
18 } | |
19 | |
20 |