We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1c7f1b commit 1f368beCopy full SHA for 1f368be
tests/dtmacid.cpp
@@ -166,7 +166,10 @@ void* writer(void* arg)
166
//work
167
//transaction<repeatable_read> txn(*conns[random() % conns.size()]);
168
transaction<read_committed> txn(*conns[random() % conns.size()]);
169
- int acc = random() % cfg.nAccounts;
+ int acc = cfg.scatter
170
+ ? random() % (cfg.nAccounts/cfg.nWriters) * cfg.nWriters + t.id
171
+ : random() % cfg.nAccounts;
172
+
173
try {
174
exec(txn, "update t set v = v + 1 where u=%d", acc);
175
txn.commit();
@@ -247,6 +250,7 @@ int main (int argc, char* argv[])
247
250
"\t-n N\tnumber of iterations (1000)\n"
248
251
"\t-p N\tupdate percent (100)\n"
249
252
"\t-c STR\tdatabase connection string\n"
253
+ "\t-s\tavoid conflicts\n"
254
"\t-i\tinitialize database\n");
255
return 1;
256
}
0 commit comments