[Development] Is QtConcurrent's code generator still in use?
thiago.macieira at intel.com
Mon Nov 19 16:42:37 CET 2012
On segunda-feira, 19 de novembro de 2012 14.03.17, Konstantin Tokarev wrote:
> > - The core of a concurrency engine should be a work-stealing data
> > structure/scheduler. Qt Concurrent has simple work-stealing
> > functionality, but is to tied to the global thread pool.
> Since number of available CPU cores is usually constant over process
> lifetime (let's forget HPC clusters :), there's nothing wrong with global
> thread pool.
By that, you immediately restrict QtConcurrent's use to CPU-bound tasks. One
can't use it anymore for tasks that involve blocking I/O, for example.
Let me give you an example of a thread pool used differently: the DNS resolver
code in QtNetwork. It uses 5 threads, regardless of how many CPU cores you
have. It involves a blocking call. And as such, it must not use the global
thread pool because it would prevent other tasks from running.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the Development