title: Can't use all cores in R
body: <p>I was trying to make a parallel loop, but I've found R can't utilize all my 8 cores, it uses only 1 with this code:</p>
  
  <pre><code>library(parallel)
  library(foreach)
  library(doParallel)
  no_cores &lt;- detectCores() - 1
  cl &lt;- makeCluster(no_cores)
  registerDoParallel(cl, cores = no_cores)
  
  sum.of.squares &lt;- foreach(i = 1:10e4, .combine = "+", .init = 0) %dopar% {
    sqrt(i)
  }
  
  stopCluster(cl)
  </code></pre>
  
  <p>It uses only about 13-15% of CPU. Why?</p>
  
  <p>Using Windows 8.1 with R 3.2.1.</p>