I agree with you Thiago. QtConcurrent runs as many threads as are processor. I submitted 21 threads through a for loop. Then the first 8 threads should be running intially right. When anyone thread is finished the does it take automatically 9th thread? and so on. I am currently doing exactly the same. But although I submitted 21 threads through QtConcurrent::run in a for loop, but I doubt if all threads are being run properly. Thats why some of the data are not being written onto the file. Let me know if I am able to make you understand the situation. On Thu, Oct 4, 2012 at 4:51 PM, Thiago Macieira <thiago.macie...@intel.com>wrote:
> On quinta-feira, 4 de outubro de 2012 15.46.57, André Somers wrote: > > If you think that running 21 threads on an 8 core system will run make > > your task go faster, then Thiago is right: you don't understand your > > problem. > > If you run 8 threads on an 8-core system and they use the CPU fully, then > you're running as fast as you can. > > If you have more threads than the number of processors and if all threads > are > ready to be executed, then the OS will schedule timeslices to each thread. > That means threads get executed and suspended all the time, sometimes > migrating between processors. That adds overhead. > > If it adds overhead, it's slower. Depending on your OS, it might be > considerably slower. > > If you do not understand what I said, understand this: there's a reason why > QtConcurrent runs as many threads as there are processors. > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > > -- Regards Sujan Dasmahapatra skype: sujan.dasmahapatra yahoo msn : dasmahapatra.aerodynam...@yahoo.co.in Mobile no : +966-530184511
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest