On Sat, Nov 14, 2009 at 02:37, Peter Bourgon <
peterb...@gmail.com> wrote:
> So, go-routine'd, parallelized computations taking in many cases
> _longer_ than their single-threaded counterparts is a known issue at
> this point?
I don't think I'd go that far. It's possible to implement coarse
parallelization with few code changes. For example, in the
$GOROOT/test/bench directory, compare spectral-norm.go
and spectral-norm-parallel.go.
On the other hand, code that spends all its time switching
between goroutines rather than computing is going to get
slower when those goroutines run in different OS threads.
A smarter scheduler might be able to keep them in a single
OS thread, but that doesn't change the fact that the program
is doing more context switching than real work.
Goroutines certainly aren't a magic bullet. They make it
easy to manage parallelism, but you still have to decide
what level of parallelism will work best for the problem at hand.
Russ