/*
- * mem.spin: Promela code to validate memory barriers with OOO memory.
+ * mem.spin: Promela code to validate memory barriers with out-of-order memory
+ * and out-of-order instruction scheduling.
+ *
+ * Algorithm verified :
+ *
+ * alpha = 0;
+ * beta = 0;
+ * x = 1;
+ * y = 1;
+ *
+ * Process A Process B
+ * alpha = 1; beta = 1;
+ * mb(); mb();
+ * x = beta; y = alpha;
+ *
+ * if x = 0, then y != 0
+ * if y = 0, then x != 0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
DECLARE_CACHED_VAR(byte, alpha, 0);
DECLARE_CACHED_VAR(byte, beta, 0);
-/* value 2 is uninitialized */
-byte read_one = 2;
-byte read_two = 2;
+byte read_one = 1;
+byte read_two = 1;
/*
* Bit encoding, proc_one_produced :