Usage of gtk_main_iteration_do ()



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.




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