main
|
Last change
on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
324 bytes
|
| Rev | Line | |
|---|
| [237da6c] | 1 | #include<civlc.cvh>
|
|---|
| 2 | #include<stdio.h>
|
|---|
| 3 |
|
|---|
| 4 | $input int N=3;
|
|---|
| 5 |
|
|---|
| 6 | int i=1,j=1;
|
|---|
| 7 | void proc0(){
|
|---|
| 8 | for(int k=0; k<N; k++)
|
|---|
| 9 | i+=j;
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | void proc1(){
|
|---|
| 13 | for(int k=0; k<N; k++)
|
|---|
| 14 | j+=i;
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | int main(){
|
|---|
| 18 | $proc p0, p1;
|
|---|
| 19 |
|
|---|
| 20 | $atomic{
|
|---|
| 21 | p0=$spawn proc0();
|
|---|
| 22 | p1=$spawn proc1();
|
|---|
| 23 | }
|
|---|
| 24 | $wait(p0);
|
|---|
| 25 | $wait(p1);
|
|---|
| [d980649] | 26 | printf("i=%d, j=%d\n", i, j);
|
|---|
| [237da6c] | 27 | }
|
|---|
| 28 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.