thread 8 つ、それぞれの thread が100万回乱数を生成して、
global 変数 sum に足していくプログラム
毎回 global 変数に足すのはアレなので、ほどよい頻度で
contention が発生する頻度として、100回ごとに sum に足す
unsigned int s = 0;
const int times = COUNT / freq;
mt19937 rg(seed);
for (int t = 0; t < times; t++) {
for (int i = 0; i < freq; i++) {
s += rg();
}
CommitPolicy::commit(s);
s = 0;
}
where COUNT = 100万 freq=100