* add Optimization build type which uses -O3

* create QTimer object in AWDataEngineAggregator class, emit signal to
  this timer because timers could not be started in the separate thread
* increase limit x2 with leaving the thread pool size as was
This commit is contained in:
arcan1s
2015-10-07 01:39:10 +03:00
parent 69c1f0ed5a
commit f7e24f680a
4 changed files with 24 additions and 7 deletions

View File

@ -49,7 +49,7 @@ AWKeys::AWKeys(QObject *parent)
#ifdef BUILD_FUTURE
// thread pool
queueLimit = QThread::idealThreadCount();
queueLimit = 2 * QThread::idealThreadCount();
threadPool = new QThreadPool(this);
#endif /* BUILD_FUTURE */
@ -115,11 +115,9 @@ void AWKeys::initKeys(const QString currentPattern, const int interval, const in
} else
dataEngineAggregator->setInterval(interval);
#ifdef BUILD_FUTURE
// queue limit. It may be configured by using QUEUE_LIMIT cmake limit flag.
// In other hand since I'm using global thread pool, it makes sense to limit
// queue by QThread::idealThreadCount() value
queueLimit = limit == 0 ? QThread::idealThreadCount() : limit;
threadPool->setMaxThreadCount(queueLimit);
int rawLimit = (limit == 0 ? QThread::idealThreadCount() : limit);
queueLimit = 2 * rawLimit;
threadPool->setMaxThreadCount(rawLimit);
#endif /* BUILD_FUTURE */
updateCache();