Re: How does gmainloop schedule GSources by priority?



Hi, Havoc

2010/8/12 Havoc Pennington <hp pobox com>
Hi,

Anyway you are correct, the main loop does not do any fancy scheduling
where it allocates time slices. Higher priorities simply always win.

Havoc
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.

I go though the code of g_io_unix_prepare, it doen't simply return true. It seems that when creating a new type of GSource, I should take care of the *prepare* method, to prevent a very high priority source of this new type blocking other sources?



--
Regards,

- cee1



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