Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-28 Thread Thiago Macieira
On Thursday 28 May 2015 11:28:53 Matthew Woehlke wrote: I create an object in Thread 1 (e.g. the main thread). This object is memory-owned by T1, i.e. it is expected that T1 will delete the object. This is what's wrong. T1 *cannot* delete the object that represents T1. If T1 is trying to

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-28 Thread Thiago Macieira
On Thursday 28 May 2015 11:31:10 Matthew Woehlke wrote: Again missing the move-back. Why is a move-back needed? What goes sideways without it? Because you want to destroy the object. You can only destroy a QObject in its thread of affinity. -- Thiago Macieira - thiago.macieira (AT)

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-28 Thread Matthew Woehlke
On 2015-05-28 01:22, Bo Thorsen wrote: The finished() signal on QThread - which thread do you expect this to run in? And which thread would you expect a slot connected to it to run in? I don't understand the question. I would expect that the signal is executed in the QThread thread. I don't

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-27 Thread Matthew Woehlke
On 2015-05-18 03:46, Thiago Macieira wrote: On Thursday 14 May 2015 18:18:52 Robert Daniels wrote: moveToThread(this); This is wrong. Never do moveToThread(this), since it's very difficult to then destroy the QThread object. This is unrelated to the problem and it's probably

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-27 Thread Thiago Macieira
On Wednesday 27 May 2015 15:02:36 Matthew Woehlke wrote: On 2015-05-18 03:46, Thiago Macieira wrote: On Thursday 14 May 2015 18:18:52 Robert Daniels wrote: moveToThread(this); This is wrong. Never do moveToThread(this), since it's very difficult to then destroy the QThread

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-27 Thread Matthew Woehlke
On 2015-05-27 16:41, Thiago Macieira wrote: On Wednesday 27 May 2015 15:02:36 Matthew Woehlke wrote: On 2015-05-18 03:46, Thiago Macieira wrote: On Thursday 14 May 2015 18:18:52 Robert Daniels wrote: moveToThread(this); This is wrong. Never do moveToThread(this), since it's very

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-27 Thread Bo Thorsen
Den 27-05-2015 kl. 23:16 skrev Matthew Woehlke: On 2015-05-27 16:41, Thiago Macieira wrote: On Wednesday 27 May 2015 15:02:36 Matthew Woehlke wrote: On 2015-05-18 03:46, Thiago Macieira wrote: On Thursday 14 May 2015 18:18:52 Robert Daniels wrote: moveToThread(this); This is wrong.

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-27 Thread Thiago Macieira
On Wednesday 27 May 2015 17:16:54 Matthew Woehlke wrote: Right. An example probably helps. What's wrong with this approach? class MyThread : public QThread { ... } // has moveToThread(this) int main() { auto* t = new MyThread; t.start(); // ... t.wait();

Re: [Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-18 Thread Thiago Macieira
On Thursday 14 May 2015 18:18:52 Robert Daniels wrote: I'm working on a project that uses a QThread to process communication over a TCP connection. In trying to improve performance I've tracked down an odd slow-down when we use QMethod::invoke to force a method to be called on the correct

[Interest] Poor QMethod::invoke performance across threads on i.MX53

2015-05-18 Thread Robert Daniels
I'm working on a project that uses a QThread to process communication over a TCP connection. In trying to improve performance I've tracked down an odd slow-down when we use QMethod::invoke to force a method to be called on the correct thread. This is an embedded project running on a Freescale