How does gmainloop schedule GSources by priority?
- From: cee1 <fykcee1 gmail com>
- To: gtk-devel-list gnome org
- Subject: How does gmainloop schedule GSources by priority?
- Date: Thu, 12 Aug 2010 10:02:52 +0800
I've read some code snippets of gmain.c. It seems a high priority(small value of priority field of GSource struct) source will cause low priority one no change to be processed:
- The source_list field of GMainContext points to a series of GSources ordered by priority(High -> low).
- In the prepare stage, *g_main_context_prepare* will only process GSources with highest priority that are ready.
- In the query stage, *g_main_context_query* will only get pollfd array ready for GSources with pollfds and higher priority than the max priority returned by *g_main_context_prepare*.
So if I have a IOChannel watch source with a high priority, and then attach an idle source, the idle source will have no change to be scheduled?
] [Thread Prev