Mercurial > hg > Members > nobuyasu > Spin
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/promela/alt2.pml Fri Jun 29 01:14:43 2012 +0900 @@ -0,0 +1,20 @@ +// Multiple Process to run alternately + +mtype = { F, S}; +mtype turn = F; + +active [2] proctype Producer() +{ + do + :: (turn == F) -> printf("Producer-%d\n",_pid); turn = S; + od +} + +active [2] proctype Consumer() +{ + do + :: (turn == S) -> printf("Consumer-%d\n",_pid); turn = F; + od +} + +