Re:Will Go be the new go-to programming language?
by luv2code on Friday September 14, 2012 @02:46AM
(#4520412)
I'm pretty sure i/o bound go routines will use the very same kernel eventing mechanism. I looked into this recently, and you have to explicitly tell it to use more than one thread with http://golang.org/pkg/runtime/#GOMAXPROCS
Re:Will Go be the new go-to programming language?
by j2labs on Friday September 14, 2012 @04:42PM
(#4523846)
Exactly.
Re:Will Go be the new go-to programming language?
by j2labs on Friday September 14, 2012 @04:42PM
(#4523844)
It certainly is. Just look at the insanity of the nonblocking I/O experience in Python. It's confusing, divided, and results in duplicated work all the way down to the database driver level.
I'm not overselling it. I'm someone who's built an entire web framework around gevent and knows that having this functionality in the library is a massive weakness of Python.
In Python, we have monkey patching vs. an entirely new driver vs. just using blocking calls.
In Go, we just have nonblocking I/O because that's how it works.
Re:Will Go be the new go-to programming language?
by JulianMorrison on Friday September 14, 2012 @05:23AM
(#4520869)
In both goroutines and events, blocking IO will be parked waiting on a select (or similar device). In both, they implicitly context switch while blocking, meaning that processing ready IO might have to wait for other stuff to reach a scheduling point. Unlike events, goroutines can be processed on more than one underlying OS thread at once.
Advantage: goroutines.
I like Go. I've been writing in it for a couple of weeks now and will continue to. But don't oversell it.