Goroutines, Nonblocking I/O, and Memory Usage
This would be solved if the &quot;select&quot; keyword was also working on I&#x2F;O objects. It could gain special io.ReadReady and io.WriteReady channels that return a boolean.<p>This would also simplify most of the code that tries to pull events from different sources, including I&#x2F;O. Right now each I&#x2F;O needs to be extracted in it&#x27;s own goroutine (adding error handling makes it worse):<p><pre><code>    fromIO := make(chan []byte)
    go func() {
       for {
          buf := myPool.Get()
          myIO.Read(buf)
          fromIO &lt;- buf
       }
    }()

    for {
      select {
      case a := &lt;-fromIO:
        &#x2F;&#x2F; do one thing
      case b := &lt;-fromOtherChan:
        &#x2F;&#x2F; something else
      }
    }
</code></pre>
After the change:<p><pre><code>    for {
      select {
      case &lt;-myIO.ReadReady:
        buf := myPool.Get()
        myIO.Read(a)
      case b := &lt;-myOtherChan:
        &#x2F;&#x2F; ...
     }</code></pre>