--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
A few ideas…
Instead of using two channels, use just one. Let the writer(s) use a “select” to do the write, else default to doing a read (then loop to try the write again). I believe that would accomplish what you are doing now but with less overhead.
I think that it’s great that you implemented this with channels first. If you need more throughput then I’d think mutexes next, and atomics as a last resort.
Perhaps using an array as a circular buffer with read and write accesses synchronized by mutexes would be a good next step.
John
John Souvestre - New Orleans LA
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.