Re: What happens if timeout events take too long?



Nils Rennebarth <nils@ipe.uni-stuttgart.de> writes:

> Before looking too deep into the source:
> 
> What if I
>     gtk_timeout_add(100,lengthy_function,NULL)
> but lengthy function takes say 200ms to execute? Will invocations be queued
> up or just thrown away? 

Thrown away essentially. There is no queuing of expired timers. 

> Will other events still be processed? 

GdkEvents will be processed, since they have the same priority as
timeouts. But slowly (one event per timeout). Redrawing and resizing
of GTK+ widgets which occurs as idles with lower priority will not
happen.

(You can set up a timeout with a given priority using g_timeout_add_full;
if it is GTK_PRIORITY_DEFAULT_IDLE or lower (numerically bigger),
then redrawing and resizing will happen)

Regards,
                                        Owen






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