[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: qsocket and excessive selects
From:       Robert Hogan <lists () roberthogan ! net>
Date:       2007-06-12 15:36:16
Message-ID: 200706121636.16437.lists () roberthogan ! net
[Download RAW message or body]

On Tuesday 12 June 2007 00:39:23 Thiago Macieira wrote:
> Robert Hogan wrote:
> >I am using qsocket to manage a connection with an external application.
> >
> >As you can see below, qsocket is performing huge numbers of selects per
> > second on the socket. I more or less copied the example implementation
> > in the qt reference docs. Is there something I can do to reduce the
> > number of selects?
>
> The problem isn't the sockets, but the timers. Note that all your
> select(2) calls ended in Timeout and all calls to read(2) end in EAGAIN.
>
> There's something in your program that has a QTimer and it's firing too
> frequently.
>
You're quite right. I thought I had weeded them all out. It was a qtimer in 
likeback that was causing the wakeups.

Thanks for the sanity check!

> >23:40:51.029136 gettimeofday({1181601651, 29424}, NULL) = 0
> >23:40:51.030041 gettimeofday({1181601651, 30338}, NULL) = 0
> >23:40:51.030821 read(3, 0x81c5ea0, 4096) = -1 EAGAIN (Resource
> > temporarily unavailable)
> >23:40:51.031609 gettimeofday({1181601651, 31903}, NULL) = 0
> >23:40:51.032402 select(16, [3 4 5 7 9 10 12 13 14 15], [], [], {0, 434})
> > = 0 (Timeout)
> >23:40:51.040885 gettimeofday({1181601651, 41168}, NULL) = 0
> >23:40:51.041778 gettimeofday({1181601651, 42076}, NULL) = 0
> >23:40:51.042559 read(3, 0x81c5ea0, 4096) = -1 EAGAIN (Resource
> > temporarily unavailable)
> >23:40:51.043339 gettimeofday({1181601651, 43631}, NULL) = 0
> >23:40:51.044099 select(16, [3 4 5 7 9 10 12 13 14 15], [], [], {0, 0}) =
> > 0 (Timeout)
> >23:40:51.044931 gettimeofday({1181601651, 45217}, NULL) = 0
> >23:40:51.045826 gettimeofday({1181601651, 46125}, NULL) = 0
> >23:40:51.046610 read(3, 0x81c5ea0, 4096) = -1 EAGAIN (Resource
> > temporarily unavailable)
> >23:40:51.047394 gettimeofday({1181601651, 47687}, NULL) = 0
> >23:40:51.048157 select(16, [3 4 5 7 9 10 12 13 14 15], [], [], {0,
> > 4650}) = 0 (Timeout)
> >23:40:51.083900 gettimeofday({1181601651, 83992}, NULL) = 0
> >23:40:51.085068 gettimeofday({1181601651, 85367}, NULL) = 0
> >23:40:51.085850 read(3, 0x81c5ea0, 4096) = -1 EAGAIN (Resource
> > temporarily unavailable)
> >23:40:51.086642 gettimeofday({1181601651, 86934}, NULL) = 0
> >23:40:51.087541 select(16, [3 4 5 7 9 10 12 13 14 15], [], [], {0,
> > 7058}) = 0 (Timeout)
> >23:40:51.096920 gettimeofday({1181601651, 97213}, NULL) = 0
> >23:40:51.097826 gettimeofday({1181601651, 98125}, NULL) = 0
> >23:40:51.098605 read(3, 0x81c5ea0, 4096) = -1 EAGAIN (Resource
> > temporarily unavailable)
> >23:40:51.099396 gettimeofday({1181601651, 99692}, NULL) = 0
> >23:40:51.100166 select(16, [3 4 5 7 9 10 12 13 14 15], [], [], {0,
> > 4300}) = 0 (Timeout)



-- 

KlamAV  - Anti-Virus Manager for KDE - http://www.klamav.net
TorK    - Anonymity Manager For KDE  - http://tork.sf.net
TorKCD  - Anonymizing LiveCD         - 
http://tork.sf.net/wiki/index.php/LiveCD
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic