DataConnectorImpl->waitAll() uses usleep and a while loop to receive data from other threads which it might affect the CPU by looping an unnecessary amount of times. This pull request changes it so it now waits for data using wait() and notify() in QueryRecvQueue by adding a new method called waitForResults. This method could be merged into fetchResults but it only returns false if there are no available threads to receive data from.
Note also: usleep doesn't really consume notable amount of CPU, especially at such a low frequency. The more significant problem is delayed notification.
DataConnectorImpl->waitAll()
usesusleep
and a while loop to receive data from other threads which it might affect the CPU by looping an unnecessary amount of times. This pull request changes it so it now waits for data usingwait()
andnotify()
inQueryRecvQueue
by adding a new method calledwaitForResults
. This method could be merged intofetchResults
but it only returnsfalse
if there are no available threads to receive data from.