title: How can my Go program keep all the CPU cores busy?
body: <p>Goroutines are light-weight processes that are automatically time-sliced onto one or more operating system threads by the Go runtime. (This is a <em>really cool</em> feature of Go!)</p>
  
  <p>Suppose I have a concurrent application like a webserver. There is plenty of stuff happening concurrently in my hypothetical program, without much non-concurrent (Amdahl's Law) ratio.</p>
  
  <p>It seems that the default number of operating system threads in use is currently 1. Does this mean that only one CPU core gets used?</p>
  
  <p>If I start my program with</p>
  
  <pre><code>runtime.GOMAXPROCS(runtime.NumCPU())
  </code></pre>
  
  <p>will that give reasonably efficient use of <strong>all</strong> the cores on my PC?</p>
  
  <p>Is there any "parallel slackness" benefit from having <em>even more</em> OS threads in use, e.g. via some heuristic</p>
  
  <pre><code>runtime.GOMAXPROCS(runtime.NumCPU() * 2)
  </code></pre>
  
  <p>?</p>