[Qt-interest] Signal/Slot model is suitable for GUI applications but it isn't for console applications

Eirik Ulvik eiriku at simsurgery.com
Mon Aug 23 15:24:19 CEST 2010


The problem is that if you go to a native direct function call it will
be executed in the thread from where the call is made while a slot will
be executed in the thread where the receiving object lives.

Eirik

Den 23.08.2010 15:21, skrev Valeriy Portnyagin:
> Eirik,
> thanks for the link.
> 
> Let's make the assumption, there is an active intra-thread communication
> with many signals and slots. Is the preferred way to use a native direct
> call of function or to stay in signal/slot model?
> 
> regards,
> Valery.
> 
> 
> 
> From: 	Eirik Ulvik <eiriku at simsurgery.com>
> To: 	qt-interest at trolltech.com
> Date: 	23.08.2010 16:57
> Subject: 	Re: [Qt-interest] Signal/Slot model is suitable for GUI
> applications but it isn't for console applications
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 
> I think it is safe to say that for inter-thread communication, queued
> signals/slots are your only option while keeping processing in the
> individual threads.
> For signal/slot performance there is something in the docs:
> http://doc.qt.nokia.com/4.6/templates.html in the chapter "Calling
> Performance is Not Everything". However I would never emit a signal in a
> tight for-loop or in compute intensive code. In my application I use
> signals and slots for syncronisations between threads and such.
> 
> Regards,
> Eirik
> 
> Den 23.08.2010 14:45, skrev Valeriy Portnyagin:
>> hi all,
>>
>> Could i say that Signal/Slot model is suitable for GUI applications but
>> it isn't  for console applications?
>> I am developing a console application with many threads. I am using the
>> signals and slots between the threads.
>> How much performance of my application will be worse at usage of
>> Signal/Slot model?
>>
>> regards,
>> Valery Portnyagin.
>>
>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100823/5c2568cf/attachment.bin 


More information about the Qt-interest-old mailing list