Changeset 4098
- Timestamp:
- Nov 11, 2009, 10:48:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/samples/src/ParCounter.rf
r4097 r4098 5 5 $use Arithm Box Parallel StdIO System; 6 6 7 $ func NewCounter = t.counter;8 $ func Incr t.counter = ;9 $ func Count t.counter = s.n;7 $public $func NewCounter = t.counter; 8 $public $func Incr t.counter = ; 9 $public $func Count t.counter = s.n; 10 10 11 11 NewCounter = … … 18 18 $iter { 19 19 <Recv s.msgbox> : e, 20 <AtomicApply &UpdateCounter s.box> : e; 20 <Box.Get s.box> : s.n, 21 <Box.Store s.box <Add s.n 1>>; 21 22 }, $fail; 22 23 $func UpdateCounter s.box = ;24 UpdateCounter s.box =25 <Box.Get s.box> : s.n,26 <Box.Store s.box <Add s.n 1>>;27 23 28 24 Incr (s.msgbox s.box) = <Send s.msgbox 1>;
Note: See TracChangeset
for help on using the changeset viewer.