News for hackers. Stuff that matters.
Re:Seven years of Go by JulianMorrison on Thursday November 10, 2016 @11:56AM (#12922028)
Isn't that a timing race? You're relying on the notification of "I'm done" getting there before the other thread tries to send.

Write-and-panic has the advantage of being atomic. And you can catch a panic.

If you have a stoppable reader like that, maybe have it pull using a channel of channels. That is, consumer sends the producer "here is a one use unbuffered channel, please put an item in it" and then blocks waiting for the response.

There are no comments on this comment yet.