News for hackers. Stuff that matters.
Re:Goroutines, Nonblocking I/O, and Memory Usage by pierrebai on Friday January 06, 2017 @01:33PM (#13338861)
One way to solve the problem is to have read return a buffer instead of providing the buffer, so that the internal read multiplexing code can do the buffer-pool trick under the hood. As long as all your readers ask for the same maximum size for the read, the pool can be shared. Under the hood, the implementation makes a select and request a buffer from the pool of the requested size.

There are no comments on this comment yet.