Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.4.3
-
None
Description
There should be a way to force QtConcurrent operations to serialize onto the main thread? For example, suppose I have a multi-threaded application and I'd like to provide a debug mode that serializes all threaded operations to ensure that threading is not a factor. I'd like to call an option like:
QtConcurrent::setSerializeOperations(true);
With this global parameter set, Any calls to QtConcurrent::run/map/mappedReduce/etc would be executed serially, in place,
on the calling thread.
Alternatively, this could be done by specifying:
QThreadPool::globalInstance.setMaxThreadCount(0);
This implementation would likely be even easier - as the implementation
could be:
void QThreadPool::start(QRunnable *runnable, int priority)
{
if(maxThreadCount == 0) // Serial execution
else
{ // .... existing code ..... } return;
}