File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,10 @@ void* writer(void* arg)
166166 // work
167167 // transaction<repeatable_read> txn(*conns[random() % conns.size()]);
168168 transaction<read_committed> txn (*conns[random () % conns.size ()]);
169- int acc = random () % cfg.nAccounts ;
169+ int acc = cfg.scatter
170+ ? random () % (cfg.nAccounts /cfg.nWriters ) * cfg.nWriters + t.id
171+ : random () % cfg.nAccounts ;
172+
170173 try {
171174 exec (txn, " update t set v = v + 1 where u=%d" , acc);
172175 txn.commit ();
@@ -247,6 +250,7 @@ int main (int argc, char* argv[])
247250 " \t -n N\t number of iterations (1000)\n "
248251 " \t -p N\t update percent (100)\n "
249252 " \t -c STR\t database connection string\n "
253+ " \t -s\t avoid conflicts\n "
250254 " \t -i\t initialize database\n " );
251255 return 1 ;
252256 }
You can’t perform that action at this time.
0 commit comments