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

Matthew Woehlke mw_triad at users.sourceforge.net
Fri May 29 17:32:38 CEST 2015


On 2015-05-28 14:02, Thiago Macieira wrote:
> 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.

What happens when a QObject is destroyed that needs to execute in the
owning thread? (Especially if that thread is no longer executing?)

I don't think destroyed() is the answer; signal emission is supposedly
thread safe, no?

On 2015-05-28 14:05, Thiago Macieira wrote:
> This is what's wrong. T1 *cannot* delete the object that represents T1. If T1 
> is trying to delete it, then T1 is running and you have a deadlock.

T1 is the main thread, deleting some object that belongs to and owns the
QThread for T2.

I've been running this code for quite some time and have not seen any
problems. If it was going to deadlock, especially if it would *always*
deadlock, I would expect I would have seen that happen by now :-).

-- 
Matthew




More information about the Interest mailing list