Barrier follow xchg atomic insn. to reduce cost.
Put barrier right after the actual write.

The key is to disallow actual read reordered to before actual write.
Comment: whether compiler barrier is needed after explicit barrier.
Use while instead of goto waiting version to be even.
Put all logs in a struct in mem-order.c
Put different access pattern into separate function.
Fix mem-dummy compile error.
Add more access pattern.
Merge branch 'develop'