Hacker News new | ask | show | jobs
by mcot2 4650 days ago
Looking at this some more... Why wouldn't you just make the waiting chan buffered and eliminate any tracking of connections.
1 comments

Hey, poster here.

You're right that sync/atomic could've taken care of this, I wasn't aware of that package and figured channels were the way to go in Go.

As for making the waiting chan buffered, the reason I wanted to keep track of pending connections and active connections is because I'd like to proxy from a high-power server to a low-power server such as a Raspberry Pi. I agree with you that it could have done without though.

Thanks for the tips! :-)

So perhaps I was a bit harsh. Do check out this set of slides though: http://talks.golang.org/2012/concurrency.slide

One of the last slides: http://talks.golang.org/2012/concurrency.slide#54

Thanks, that's an awesome resource!