[Interest] Scalability of QTimer or QObject::startTimer

Prashant prashant.me at gmail.com
Tue Oct 30 11:54:34 CET 2012


Thanks for the responses. My current implementation, is not bold(read
stupid) enough to go out in the high waters and test a 100k timers. What I
do essentially is to keep a single timer, have it's timeout at hcf of
required and .. you get the idea.
To have the individual objects manage it sounds easy to manage, codewise.
And if the QTimer implementation is read, it essentially does something
like at every application event loop rerun, it subtracts x from all the
timers. Whichever is zero or less is fired.
So, my only overhead is function call, in a distributed thousands of
timers. Qt itself is doing the same thing as what I am doing. And must be
more efficient too. I need to test the theory, but I can't think how.
Regards,
On Fri, Oct 26, 2012 at 9:10 PM, Charley Bay <charleyb123 at gmail.com> wrote:

> Prashant spaketh:
> > <snip>, However, QTimer documentation states that
> > "If Qt is unable to deliver the requested number of timer clicks, it will
> > silently discard some."
> > I don't know how to interpret this statement. Does it mean that if a
> timer
> > has a very low resolution, some clicks are neglected. OR does it mean
> that
> > if a significant number of clicks from various timers happens at around
> the
> > same time, clicks will be discarded. <snip>,
>
> Bo respondeth:
> > <snip>,
> > It means if the thread is busy for so long that the timer should have
> fired
> > X times, it may fire anything from 1 to X times. But it will at least
> fire
> > once.
>
> Good answer by Bo.
>
> I don't have "documentation-authority", but IMHO the docs should be
> updated to something like:
>
> CURRENT:
> "If Qt is unable to deliver the requested number of timer clicks, it
> will silently discard some."
>
> PROPOSED:
> "If Qt is unable to deliver the requested number of timer clicks, it
> will silently collapse "N" clicks to "1+" clicks."
>
> --charley
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



-- 
Prashant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121030/a072ac32/attachment.html>


More information about the Interest mailing list