3 ms·
Looking at this some more... Why wouldn't you just make the waiting chan buffered and eliminate any tracking of connections.
by mcot2 13y ago
Looking at this some more... Why wouldn't you just make the waiting chan buffered and eliminate any tracking of connections.
- jokeofweek 13y agoHey, 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! :-)
- mcot2 13y agoSo perhaps I was a bit harsh. Do check out this set of slides though: http://talks.golang.org/2012/concurrency.slide http://talks.golang.org/2012/concurrency.slide One of the last slides: http://talks.golang.org/2012/concurrency.slide#54 http://talks.golang.org/2012/concurrency.slide#54
- jokeofweek 13y agoThanks, that's an awesome resource!