source: CIVL/examples/concurrency/spawn.cvl@ 9705dfd

1.23 2.0 main test-branch
Last change on this file since 9705dfd was 20d2740, checked in by Stephen Siegel <siegel@…>, 13 years ago

Worked with Tim to get first message-passing example up. Cleaned up concurrency tests somewhat.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@280 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 441 bytes
Line 
1/* spawn.cvl: simple example of spawning two processes.
2 * A good test for reduction: verification should avoid
3 * exploring all interleavings. It should in fact
4 * reduce to a single interleaving.
5 * civl verify -inputN=10 spawn.cvl
6 */
7#include<civlc.h>
8
9$input int N;
10
11void f(int n) {
12 int i = 0;
13
14 for (i=0; i<n; i++) ;
15 $assert i==n;
16}
17
18void main() {
19 $proc p = $spawn f(N);
20 $proc q = $spawn f(N);
21
22 $wait p;
23 $wait q;
24}
Note: See TracBrowser for help on using the repository browser.