title: Why doesn't the Go statement execute in parallel?
body: <p>I'm testing this Go code on my VirtualBoxed Ubuntu 11.4</p>
  
  <pre><code>package main
  
  import ("fmt";"time";"big")
  var c chan *big.Int
  
  func sum( start,stop,step int64) {
      bigStop := big.NewInt(stop)
      bigStep := big.NewInt(step)
      bigSum  := big.NewInt(0)
      for i := big.NewInt(start);i.Cmp(bigStop)&lt;0 ;i.Add(i,bigStep){
          bigSum.Add(bigSum,i)
      }
      c&lt;-bigSum           
  }
  
  func main() {
      s := big.NewInt( 0 )
      n := time.Nanoseconds()
  
      step := int64(4)
      c = make( chan *big.Int , int(step))
      stop := int64(100000000)
      for j:=int64(0);j&lt;step;j++{
          go sum(j,stop,step)     
      }
      for j:=int64(0);j&lt;step;j++{
          s.Add(s,&lt;-c)
      }
      n = time.Nanoseconds() - n
      fmt.Println(s,float64(n)/1000000000.)
  }
  </code></pre>
  
  <p>Ubuntu has access to all my 4 cores. I checked this with simultaneous run of several executables and System Monitor.
  But when I'm trying to run this code, it's using only one core and is not gaining any profit of parallel processing.</p>
  
  <p>What I'm doing wrong?</p>