Hi Thiago! On Thu, Apr 10, 2014 at 11:13 AM, Thiago Macieira <thiago.macie...@intel.com> wrote: > Em qui 10 abr 2014, às 09:42:25, Roland Winklmeier escreveu: >> 1. Subclassing QThread: I've read you should avoid that, so I don't really >> consider it >> 2. Move it to thread: networkWorker->moveToThread(thread); >> 3. High level API's: QtConcurrent/QRunning >> >> The requirements are: >> - Run infinite - stop only when requested >> - Needs to run threads event loop >> - Able to call slots via queued events >> and the most critical part >> - direct function calls synchronized via Mutexes from main thread > > Go for option 1: > > void ThreadClass::run() > { > forever { > DoTask(); > sleep(1); > } > }
But Thiago -- You, of all people! -- How's he then going to get his queued-event slot calls to run in the worker thread unless he calls ThreadClass::moveToThread (this) ?!!? > It's horrible, but not because of QThread. > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center Happy Multi-Threaded Hacking! K. Frank _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest