Re: How does gmainloop schedule GSources by priority?



Hi,

On Sat, Aug 14, 2010 at 9:57 AM, cee1 <fykcee1 gmail com> wrote:
> I've written a test program, which creating watches for two GIOChannels: one
> for stdin with a low priority, and the other for a named pipe with a high
> priority. Then ran the program with no data written to the named pipe, it
> can still response to input of stdin, which seems like high priority sources
> will not block low priority sources.

Priorities only matter if the sources are both ready. If only stdin
has data and the higher priority one doesn't then the lower priority
would run.

prepare and check both return TRUE if the source is ready (should be
dispatched, i.e. its callback should be invoked). the difference is
that prepare is pre-poll and check is post-poll.

Havoc


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