[Qt-interest] Socket communication without threads

Thiago Macieira thiago.macieira at trolltech.com
Tue Mar 3 08:10:47 CET 2009


Predrag Manojlovic wrote:
>To be more precise:
>1. First client connects
>2. sendFortune() slot is triggered and takes time (read large data from
>file and send to socket), are other clients waiting? Or we have multiple
>sendFortune() instances working at same time?

You shouldn't have to ask this. If there's only one thread running, while 
that thread is doing some work, no other work is being done.

The question is then: why are you taking so much time? If your processing 
operation does take that much time, then yes, use a thread. Otherwise, 
maybe you should consider splitting the work?

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090302/0f91524b/attachment.bin 


More information about the Qt-interest-old mailing list