<p><b>@zhekov</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1461#discussion_r155500981">src/spawn.c</a>:</p>
<pre style='color:#555'>> @@ -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++;
</pre>
<p><a href="https://github.com/b4n" class="user-mention">@b4n</a></p>
<p>Citing myself: "The empty gio IN-s for a channel seem to start as soon as data appears on that channel, and never end. Or, they may end after some unpredictable time (minutes or more) [...]"</p>
<p>AFAICT, the "successful" read attempts are only such because there incidently happens to be any data when the subsequent G_IN is delivered.<br>
If the counter is reset, there is a risk that small portions of data will be read at, say, each 100 G_IN-s, and Geany/Scope will work, but slow. I chose 200 as the limit because it does not cause a noticeable <em>one-time</em> slowdown before switching to timeouts even, on slow CPU-s.</p>
<p>I'm not against decrementing the counter, or even substracting some fixed ammount <= 10, if you consider that more safe. Just don't do it after the counter reaches maximum, it's also an indicator that input has switched to timeouts.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1461#discussion_r155500981">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ6KlwOIfpG0GZXzz8xGRCvhYNURjks5s99HlgaJpZM4M3KqU">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJxv2sJ6d5ObtAIGkHWNCbQItBIC6ks5s99HlgaJpZM4M3KqU.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1461#discussion_r155500981"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@zhekov commented on #1461"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1461#discussion_r155500981"}}}</script>