[Github-comments] [geany/geany] Handle continuous G_IO_IN-s without any data (#1461)
Colomban Wendling
notifications at xxxxx
Fri Dec 8 01:35:37 UTC 2017
b4n commented on this pull request.
> @@ -967,6 +1002,25 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
sc->cb.read(buffer, input_cond | failure_cond, sc->cb_data);
}
+ /* Check for continuous activations with G_IO_IN | G_IO_PRI, without any
+ data to read and without errors. If detected, switch to timeout source. */
+ else if (SPAWN_CHANNEL_GIO_WATCH(sc) && status == G_IO_STATUS_AGAIN)
+ {
+ sc->empty_gio_ins++;
@zhekov OK. My reasoning was that if you don't switch right away, it suggests empty INs could happen in situations where switching to a timeout source is not a good idea or the thing to do; so that maybe they could happen rarely and not be a real problem hence not being worth switching.
But if you tell me the reason to wait for 200 empty INs before switching is e.g. not to bother switching for short-lived output, I get that and then it wouldn't we worth worrying about decrementing the value.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1461#discussion_r155686796
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20171208/b9f4a9dd/attachment-0001.html>
More information about the Github-comments
mailing list