Revert "Revert "Add some thread yields""

This reverts commit 97165dd278.
This commit is contained in:
Daniel Smith 2020-08-13 15:12:54 +00:00
parent d3ad73906f
commit c2e49b2dfa
1 changed files with 4 additions and 0 deletions

View File

@ -373,6 +373,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
a->batchToCommit = std::move(writeBatch);
auto res = a->done.getFuture();
writeThread->post(a);
threadYield();
return res;
}
@ -380,6 +381,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadValueAction(key, debugID);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}
@ -387,6 +389,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadValuePrefixAction(key, maxLength, debugID);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}
@ -394,6 +397,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadRangeAction(keys, rowLimit, byteLimit);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}