/* This program (although it doesn't do anything) does some things that * behave differently in shared and distrubuted environments */ typedef struct { char a[100]; } hi; typedef char arr[100]; @process legal(hi there) {/* Passing structures by value is legal under gcc (which is what we are using) */ /* Can refer to there.a[0] */ } @process not_quiet_legal(arr a) { /* This passes in a pointer and although it might work in shared-memory * type situations it will not work in a distributed environment * * Actually, since this implementation packs arguments to @process's * into a struct this code will not do what you expect it to... and * the compiler will warn you that something strange is going on... */ } eMain() { hi mum; arr b; @cooperate { legal(mum); not_quiet_legal(b) /* DO NOT put a ; here! */ } /* It would be especially naughty to assume that elements of b * had changed at this point in the program */ }