[Interest] Signal and Slot mechansim in Qt4.8.x

Bo Thorsen bo at vikingsoft.eu
Fri Aug 8 13:00:31 CEST 2014


Den 08-08-2014 12:15, Giuseppe D'Angelo skrev:
> Il 08/08/2014 10:51, Bo Thorsen ha scritto:
>> The order of the slots execution is undefined. You can not rely on it.
>
> Generally speaking it *is* defined: slot activation follows the order of
> the connect() statements (*).

Yes.

> In this specific case, there are multiple threads in the game, and the
> question doesn't elaborate enough on what's the actual structure of the
> connections (which threads emit which signals? what are those signals
> connected to? which connection types are sued?) to be able to know
> what's going on.

It's the threads that kill this. He said that multiple threads are 
emitting at the same time (I'm assuming this means multiple cores on the 
target machine). I think it would be very dangerous to assume anything 
on the ordering of this. If he needs a strict order of this, he should 
implement a producer-consumer system for the messages instead.

Bo.

-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu



More information about the Interest mailing list