On Tuesday, 27 de September de 2011 19:38:04 Oswald Buddenhagen wrote: > On Tue, Sep 27, 2011 at 05:43:20PM +0200, ext Thiago Macieira wrote: > > On Tuesday, 27 de September de 2011 17:13:28 Oswald Buddenhagen wrote: > > > i wonder whether it would be possible to make a qthread subclass which > > > would be a generic sync wrapper for async apis, so one could dispose of > > > the waitFor*() in the i/o devices without requiring the users to write > > > lots of boilerplate code. > > > > Making that class is easy. > > > > Making the I/O classes work properly with being moved across threads > > (moving their timers and socket notifiers) and deal with concurrent > > access to the I/O buffers, that's not trivial at all. > > that would be easy if we require that prior to wrapping only setters can > be used and setters must have no internal side effects. of course, that > means that opening the device in a class-specific way needs to be done > in the thread already. doing *that* generically may turn out, uhm, > challenging. it may be more appropriate to have a QFooWaiter for every > relevant QFoo.
You can't do that if there are shared resources. For example, QNetworkReply is
just a small window into the QNetworkAccessManager's resources. You cannot
move just the QNR. You need to move the entire QNAM along with all currently
active QNRs.
That severely limits the usefulness of moving to a thread. Even if you manage
to do that, the waitFor function might still trigger other signals emitting,
from other objects.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
