summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentiteratekernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/concurrent/qtconcurrentiteratekernel.h')
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h
index 3095c9ff52..09009efedc 100644
--- a/src/concurrent/qtconcurrentiteratekernel.h
+++ b/src/concurrent/qtconcurrentiteratekernel.h
@@ -61,37 +61,13 @@ namespace QtConcurrent {
reserve and process at a time. This is done by measuring the time spent
in the user code versus the control part code, and then increasing
the block size if the ratio between them is to small. The block size
- management is done on the basis of the median of several timing measuremens,
- and it is done induvidualy for each thread.
+ management is done on the basis of the median of several timing measurements,
+ and it is done individually for each thread.
*/
class Q_CONCURRENT_EXPORT BlockSizeManager
{
public:
- BlockSizeManager(int iterationCount);
- void timeBeforeUser();
- void timeAfterUser();
- int blockSize();
-private:
- inline bool blockSizeMaxed()
- {
- return (m_blockSize >= maxBlockSize);
- }
-
- const int maxBlockSize;
- qint64 beforeUser;
- qint64 afterUser;
- Median<double> controlPartElapsed;
- Median<double> userPartElapsed;
- int m_blockSize;
-
- Q_DISABLE_COPY(BlockSizeManager)
-};
-
-// ### Qt6: Replace BlockSizeManager with V2 implementation
-class Q_CONCURRENT_EXPORT BlockSizeManagerV2
-{
-public:
- explicit BlockSizeManagerV2(int iterationCount);
+ explicit BlockSizeManager(int iterationCount);
void timeBeforeUser();
void timeAfterUser();
@@ -106,11 +82,11 @@ private:
const int maxBlockSize;
qint64 beforeUser;
qint64 afterUser;
- MedianDouble controlPartElapsed;
- MedianDouble userPartElapsed;
+ Median controlPartElapsed;
+ Median userPartElapsed;
int m_blockSize;
- Q_DISABLE_COPY(BlockSizeManagerV2)
+ Q_DISABLE_COPY(BlockSizeManager)
};
template <typename T>
@@ -221,7 +197,7 @@ public:
ThreadFunctionResult forThreadFunction()
{
- BlockSizeManagerV2 blockSizeManager(iterationCount);
+ BlockSizeManager blockSizeManager(iterationCount);
ResultReporter<T> resultReporter(this);
for(;;) {