

Concurrency in Go: A Better Call Center Tutorial - c141charlie
http://www.mprescient.com/journal/2011/1/30/concurrency-in-go-a-better-call-center-tutorial.html

======
jbooth
"In Java doing the above is not that simple. This is because the max number of
threads you can launch is limited to the size of your system and is typically
less than 100."

.... huh? Pretty sure I run Java applications with a higher max threads than
that all the time. Although, yes, it's good practice to not have too many more
than cores unless you want to schedule a lot of I/O requests at once.

I've actually been writing some Go lately, and I like the way channels and
goroutines work, but you can (and should) do the exact same thing in Java with
SynchronousQueues and ExecutorServices. Those map exactly to channels and
goroutines, and are more expressly configurable (which is a plus and minus).
It's a little more syntax but it's really flexible and performant.

~~~
c141charlie
Good to know about SynchronousQueues and ExecutorServices. I had not heard of
these before.

~~~
jbooth
Yeah, check the source for the static builders in Executors, like
Executors.newCachingThreadPool, newFixedThreadPool, etc. They're all just
different ways of wrapping ExecutorServices around a task Queue.

