Skip to content

Commit f7d173e

Browse files
More detailed description of GetWorkerThreadId. Remove comments duplication
commit_hash:19ac2b49b9bb7ac988b229e4d5c4c4ed6f75b138
1 parent 4638675 commit f7d173e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

library/cpp/threading/local_executor/local_executor.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ namespace NPar {
5454
// @param flags Same as for `Exec`.
5555
virtual void ExecRange(TIntrusivePtr<ILocallyExecutable> exec, int firstId, int lastId, int flags) = 0;
5656

57-
// 0-based ILocalExecutor worker thread identification
57+
// returns:
58+
// 0 for for a thread outside the internal pool
59+
// (because ILocalExecutor is allowed to use a calling thread to execute tasks as well),
60+
// 1 ... GetThreadCount() for a thread inside the internal pool
5861
virtual int GetWorkerThreadId() const noexcept = 0;
62+
5963
virtual int GetThreadCount() const noexcept = 0;
6064

6165
// Describes a range of tasks with parameters from integer range [FirstId, LastId).
@@ -237,7 +241,6 @@ namespace NPar {
237241
int GetLPQueueSize() const noexcept;
238242
void ClearLPQueue();
239243

240-
// 0-based TLocalExecutor worker thread identification
241244
int GetWorkerThreadId() const noexcept override;
242245
int GetThreadCount() const noexcept override;
243246

library/cpp/threading/local_executor/tbb_local_executor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace NPar {
1919
, NumberOfTbbThreads(nThreads) {}
2020
~TTbbLocalExecutor() noexcept override {}
2121

22-
// 0-based ILocalExecutor worker thread identification
2322
virtual int GetWorkerThreadId() const noexcept override;
2423
virtual int GetThreadCount() const noexcept override;
2524

0 commit comments

Comments
 (0)