I have done a naive (and perhaps incorrect) attempt at:
https://gist.github.com/kedarmhaswade/6894081. A few runs [1] of this Java program (on my quadcore Linux box) make me believe that it's possible that the FIFO contract of the queue is violated while the program still remains correct as far as the sequential consistency is concerned. Is this what the book trying to say above? And is this program I've written any good?
1.
➜ mt git:(master) ✗ java -server SurprisingSequentialConsistency
➜ mt git:(master) ✗ java -server SurprisingSequentialConsistency
➜ mt git:(master) ✗ java -server SurprisingSequentialConsistency
surprising!
aput_time: 1381284014019
bput_time: 1381284014020
put value: 3
took value: 1
➜ mt git:(master) ✗ java SurprisingSequentialConsistency
➜ mt git:(master) ✗ !javac
➜ mt git:(master) ✗ javac -g SurprisingSequentialConsistency.java
➜ mt git:(master) ✗ java -server SurprisingSequentialConsistency
surprising!
aput_time: 1381284035117
bput_time: 1381284035118
put value: 151
took value: 66