[Qt-interest] Qt signaling smarts...
BRM
bm_witness at yahoo.com
Tue Nov 24 20:10:30 CET 2009
Well..the copying for the queued threads is not really an issue - pretty much all the data that is passed is via QByteArray objects that are setup in the thread.
So the copying for the events are cheap, to my understanding.
I've been using the QThread2-threads in another related program without any problems, and memory usage is pretty stable despite thousands of these messages being sent.
Ben
----- Original Message ----
From: Will Rutherdale (rutherw) <rutherw at cisco.com>
To: KC Jones <kc at asperasoft.com>; BRM <bm_witness at yahoo.com>
Cc: qt-interest <qt-interest at trolltech.com>
Sent: Tue, November 24, 2009 2:00:39 PM
Subject: RE: [Qt-interest] Qt signaling smarts...
A simpler way to avoid marshalling of big data between threads is to
subclass from QEvent. QCoreApplicatin::postEvent() will then put the
event object into the event queue for the thread to which the object
belongs. You handle the incoming event by over-riding QObject::event().
-Will
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of KC Jones
> Sent: 24 November 2009 13:51
> To: BRM
> Cc: qt-interest
> Subject: Re: [Qt-interest] Qt signaling smarts...
>
> > In my actual program, thread1 is going to be generating a
> lot of data that may go to multiple instances of thread2;
> > and I would rather not have to have all that data get
> crammed through program's main thread and main event loop,
> > but instead go directly to the thread2's event loop.
>
> I have nothing to add re: intra thread signaling, but I will point out
> that signal/slot calls, especially queued, imply copying all of the
> passed data. So if you have a large volume of data you might need to
> transmit it through some other mechanism (file, socket, etc.) and use
> the signaling to marshal that resource between threads.
>
> But that's not really the advice what you were asking for...
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list