aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/local_executor/local_executor.h
diff options
context:
space:
mode:
authorAnna Veronika Dorogush <annaveronika@yandex-team.ru>2022-02-10 16:51:00 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:00 +0300
commit9164d180a5c1f96e8d270f59bba1fbc7102889fd (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/threading/local_executor/local_executor.h
parent422daa60ebc422624f4621c54ad0e600134cc621 (diff)
downloadydb-9164d180a5c1f96e8d270f59bba1fbc7102889fd.tar.gz
Restoring authorship annotation for Anna Veronika Dorogush <annaveronika@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/local_executor/local_executor.h')
-rw-r--r--library/cpp/threading/local_executor/local_executor.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/threading/local_executor/local_executor.h b/library/cpp/threading/local_executor/local_executor.h
index 7939198b23..c1c824f67c 100644
--- a/library/cpp/threading/local_executor/local_executor.h
+++ b/library/cpp/threading/local_executor/local_executor.h
@@ -68,7 +68,7 @@ namespace NPar {
, LastId(SafeIntegerCast<int>(lastId))
{
Y_ASSERT(LastId >= FirstId);
- SetBlockSize(1);
+ SetBlockSize(1);
}
// Partition tasks into `blockCount` blocks of approximately equal size, each of which
// will be executed as a separate bigger task.
@@ -78,7 +78,7 @@ namespace NPar {
Y_ASSERT(SafeIntegerCast<int>(blockCount) > 0 || FirstId == LastId);
BlockSize = FirstId == LastId ? 0 : CeilDiv(LastId - FirstId, SafeIntegerCast<int>(blockCount));
BlockCount = BlockSize == 0 ? 0 : CeilDiv(LastId - FirstId, BlockSize);
- BlockEqualToThreads = false;
+ BlockEqualToThreads = false;
return *this;
}
// Partition tasks into blocks of approximately `blockSize` size, each of which will
@@ -89,22 +89,22 @@ namespace NPar {
Y_ASSERT(SafeIntegerCast<int>(blockSize) > 0 || FirstId == LastId);
BlockSize = SafeIntegerCast<int>(blockSize);
BlockCount = BlockSize == 0 ? 0 : CeilDiv(LastId - FirstId, BlockSize);
- BlockEqualToThreads = false;
+ BlockEqualToThreads = false;
return *this;
}
// Partition tasks into thread count blocks of approximately equal size, each of which
// will be executed as a separate bigger task.
//
TExecRangeParams& SetBlockCountToThreadCount() {
- BlockEqualToThreads = true;
- return *this;
- }
+ BlockEqualToThreads = true;
+ return *this;
+ }
int GetBlockCount() const {
- Y_ASSERT(!BlockEqualToThreads);
+ Y_ASSERT(!BlockEqualToThreads);
return BlockCount;
}
int GetBlockSize() const {
- Y_ASSERT(!BlockEqualToThreads);
+ Y_ASSERT(!BlockEqualToThreads);
return BlockSize;
}
bool GetBlockEqualToThreads() {
@@ -115,9 +115,9 @@ namespace NPar {
const int LastId = 0;
private:
- int BlockSize;
- int BlockCount;
- bool BlockEqualToThreads;
+ int BlockSize;
+ int BlockCount;
+ bool BlockEqualToThreads;
};
// `Exec` and `ExecRange` versions that accept functions.
@@ -277,7 +277,7 @@ namespace NPar {
inline void ParallelFor(ILocalExecutor& executor, ui32 from, ui32 to, TBody&& body) {
ILocalExecutor::TExecRangeParams params(from, to);
params.SetBlockCountToThreadCount();
- executor.ExecRange(std::forward<TBody>(body), params, TLocalExecutor::WAIT_COMPLETE);
+ executor.ExecRange(std::forward<TBody>(body), params, TLocalExecutor::WAIT_COMPLETE);
}
template <typename TBody>
@@ -289,6 +289,6 @@ namespace NPar {
inline void AsyncParallelFor(ui32 from, ui32 to, TBody&& body) {
ILocalExecutor::TExecRangeParams params(from, to);
params.SetBlockCountToThreadCount();
- LocalExecutor().ExecRange(std::forward<TBody>(body), params, 0);
+ LocalExecutor().ExecRange(std::forward<TBody>(body), params, 0);
}
}