Re: Question about GTK+ and timers

Hi, Paul,
My task is to read the external device thru the serial port with the 1
sec interval.
And then update the GUI with the new data.
At least the documentation of this device says that it will write with 1 sec.

I am testing on x86, then cross-compiling for ARM and run the program on ARM.

Will I be better off with just continuous loop inside thread or the
timer will do?

Thank you.

On Wed, Apr 6, 2011 at 12:05 PM, Paul Davis <paul linuxaudiosystems com> wrote:
> On Wed, Apr 6, 2011 at 2:49 PM, Igor Korot <ikorot01 gmail com> wrote:
>> Hi, ALL,
>> I read that the timer event processing is differ between x86 and ARM.
>> On x86 it fires at 1/1000 interval, on ARM it fires at 10/1000
>> interval.
>> If I use g_timeout_add_seconds( 1, ...) am I guaranteed that the timer
>> events will fire with 1 sec interval independently of the arch?
> you're not guaranteed anything about timeouts. if you are relying on
> them for precise timing, you've made a mistake already. within the
> context of a GUI, with its (typically slow) human interaction times,
> they are entirely accurate enough. for anything else, not at all.
> the timeout will execute as part of the glib event loop that its a
> part of. your callback could be delayed by arbitrary amounts of time
> by other, higher priority callbacks.
> however, if the interval is 1 second, then you can be assured that
> your callback is almost certainly going to execute very, very close to
> once every second.
> --p

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]