Re: Usage of gtk_main_iteration_do ()
- From: Harring Figueiredo <harringf yahoo com>
- To: Russell Shaw <rjshaw iprimus com au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Usage of gtk_main_iteration_do ()
- Date: Sun, 13 Apr 2003 12:55:13 -0700 (PDT)
What are the chances that this will be the only process ? - in any regularlinux
intallation we have more than 100 daemon running on the background anyhow.
Harring.
--- Russell Shaw <rjshaw iprimus com au> wrote:
Russell Shaw wrote:
Harring Figueiredo wrote:
If you need to do something based on time, why can't you use
g_timeout_add ?
I wanted only for the loop to run once every time slice of the linux
scheduler.
I found the ideal function is sched_yield():
while(!gtk_main_iteration_do(0)){ // non-blocking
a_non_blocking_function();
sched_yield();
}
On second thoughts, the cpu would spin if this is the only process.
Might be better to just sleep for 100ms.
while(!gtk_main_iteration_do(0)){ // non-blocking
a_non_blocking_function();
poll(NULL,0,100);
}
_______________________________________________
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]