![]() |
![]() |
|
02158 Concurrent Programming Fall 2024 |
Spin: Tips and Tricks |
Home | Plan | Material |
Instance numbers may be calculated from the number of
active processes created.
Alternatively, processes may be started
explicitly by an init process and their instantiation numbers
recorded in global values:
pid up1, up2, down1, down2;
init {
atomic {
up1 = run Car(UP);
up2 = run Car(UP);
down1 = run Car(DOWN);
down2 = run Car(DOWN)
}
}
Now you may refer to e.g. Car[up1]@entry in LTL-definitions.
[For a more flexible solution you may, of course, use arrays of pid's]
Hans Henrik Løvengreen, Oct 3, 2024 |