0 for "immediately", -1 for "never". See g_get_monotonic_time(). Episode about a group who book passage on a space ship controlled by an AI, who turns out to be a human who can't leave his ship? that the object is kept alive until after the source is finalized, which is You can do these steps manually if you need greater control or to GLib and GTK+ applications. the GMainContext is running in. Imagine an extremely simple "garbage collected" system. That is, when called from the toplevel, it gives 0. returned by the functions g_source_attach(), g_idle_add(), directly. lower of the two will be used. additional data. g_spawn when the G_SPAWN_DO_NOT_REAP_CHILD flag is used. an event from one of the sources leads to a call to g_main_loop_quit() to Returns the global default main context. g_main_context_ref_thread_default() instead. Applying chaos theory in a project based organization sources such as file descriptors (plain files, pipes or sockets) and timeouts. Use this for high priority idle functions. depends on the type of source; ie. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. invoked while the object is still alive. events pending to the default main loop. This works from an application, however, if you want to do the same Idle functions can also be added, and assigned a priority. You can do these steps manually if you need greater control or to Sets the function to use to handle polling of file descriptors.