Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f368be

Browse files
knizhnikkelvich
authored andcommitted
Add -s option to dtmacid
1 parentd1c7f1b commit1f368be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎tests/dtmacid.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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\tnumber of iterations (1000)\n"
248251
"\t-p N\tupdate percent (100)\n"
249252
"\t-c STR\tdatabase connection string\n"
253+
"\t-s\tavoid conflicts\n"
250254
"\t-i\tinitialize database\n");
251255
return1;
252256
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp