Add some thread yields

This commit is contained in:
Daniel Smith 2020-08-05 21:45:48 +00:00
parent 50b1649f8d
commit 3485f1addd
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
a->batchToCommit = std::move(writeBatch);
auto res = a->done.getFuture();
writeThread->post(a);
threadYield();
return res;
}
@ -345,6 +346,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadValueAction(key, debugID);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}
@ -352,6 +354,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadValuePrefixAction(key, maxLength, debugID);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}
@ -359,6 +362,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
auto a = new Reader::ReadRangeAction(keys, rowLimit, byteLimit);
auto res = a->result.getFuture();
readThreads->post(a);
threadYield();
return res;
}