Re: Usage of gtk_main_iteration_do ()




 If you need to do something based on time, why can't you use g_timeout_add ?

--- Russell Shaw <rjshaw iprimus com au> wrote:
Hi,

If i do:

while(!gtk_main_iteration_do(0)){  // non-blocking
   a_non_blocking_function();
}

then will this waste lots of cpu cycles?

Should i do:

while(!gtk_main_iteration_do(0)){  // non-blocking
   a_non_blocking_function();
   usleep(10000);
}

to check everything 100 times a second?

Is there a function to tell the linux scheduler to end the current
time slice? That way i could replace usleep() with a scheduler
yield function.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com



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