2 * This model describes the interaction between aio_set_dispatching()
5 * Author: Paolo Bonzini <pbonzini@redhat.com>
7 * This file is in the public domain. If you really want a license,
11 * spin -p docs/aio_notify.promela
14 * spin -a docs/aio_notify.promela
20 #define LAST (1 << (MAX - 1))
21 #define FINAL ((LAST << 1) - 1)
28 active proctype waiter()
34 // Computing "blocking" is separate from execution of the
36 blocking = (req == 0);
38 // This is our "bottom half"
39 atomic { fetch = req; req = 0; }
42 // Wait for a nudge from the other side
44 :: event == 1 -> { event = 0; break; }
45 :: !blocking -> break;
50 // If you are simulating this model, you may want to add
51 // something like this here:
53 // int foo; foo++; foo++; foo++;
55 // This only wastes some time and makes it more likely
56 // that the notifier process hits the "fast path".
64 active proctype notifier()
77 :: dispatching == 0 -> sets++; event = 1;
81 // Test both synchronous and asynchronous delivery
91 printf("Skipped %d event_notifier_set\n", MAX - sets);
94 #define p (done == FINAL)
98 :: 1 // after an arbitrarily long prefix
99 :: p -> break // p becomes true
102 :: !p -> accept: break // it then must remains true forever after