title: progress bar not working in foreach setting
body: <p>I have the following <code>foreach</code> setting in Ubuntu system where I need to have a progress-bar to monitor the progress.</p>
  
  <pre><code>library(doMC)
  registerDoMC(cores=detectCores()-1)
  total &lt;- 9000
  # create progress bar
  pb &lt;- txtProgressBar(min = 0, max = total, style = 3)
  respar &lt;- foreach(i = 1:total, .combine = rbind)%dopar%{
    setTxtProgressBar(pb, i)
    i**3
  }
  close(pb)
  </code></pre>
  
  <p>However, the above the implementation is not working but the output in <code>respar</code> is as expected. Could you please comment if there is something wrong with this approach?</p>
  
  <p>Note: The question is to identify the error in this approach of creating the progress-bar. The other similar questions did not deal with this combination of background setup for progress-bar creation.</p>