Testing whether a thread execution is possible under a certain weak memory consistency model expects usually an abstraction of a thread's execution to just read and write instructions. Hence, you may be surprised to see such an exercise where if-statements occur. However, you can easily translate the if-statement to a read operation. For instance, if(y=2) z := 1 executes z := 1 only if y=2 holds, and to that end, we have to perform a read(y,2) before the write(z,1) in that thread. You can see that also in the example solution. If another value than 2 would be read for y, the other thread is empty, and then the result is trivial.
Apart from that simple translation of statements to read/write sequences, statements are not relevant for testing whether thread executions are consistent for a weak memory consistency model.
About the Steinke-Nutt classification: Yes, you should know it, but that can be reduced to the following basics which are essentially:
- It is a systematic approach to define many possible weak memory consistency models. The four basic models GPO, GDO, GWO, GAO can be combined to define 2^4 = 16 weak memory consistency models that may or may not have these basic models integrated. The 16 weak memory consistency models form a lattice concerning their strength.
- GPO is just another name for PRAM consistency; its definition is exactly the same.
- GDO is equivalent to cache consistency; its definition is however processor-oriented instead of variable-oriented as the definition of cache consistency. So, it makes this way all definitions processor-oriented.
- You do not need to consider the proof that GDO is equivalent to cache consistency, but you should know it.
- GPO+GDO is almost equivalent to processor consistency; and it is believed to be the real intention of the latter.
- slide 115 of the chapter summarizes the main results of Steinke-Nutt