# Parallel Processing in R for Windows

- Author: DavidMSmith
- Published: 2011-03-04
- Canonical: https://www.smartdatacollective.com/parallel-processing-r-windows/

The [doSMP package](http://cran.r-project.org/web/packages/doSMP/) (and its companion package, [revoIPC](http://cran.r-project.org/web/packages/revoIPC/)), previously bundled only with Revolution R, is now available on CRAN for use with open-source R under the GPL2 license.

In short, doSMP makes it easy to do [SMP](http://en.wikipedia.org/wiki/Symmetric_multiprocessing) parallel processing on a Windows box with multiple processors. (It works on Mac and Linux too, but it's been relatively easy to do parallel processing on those systems for a while with [doMC](http://cran.r-project.org/web/packages/doMC/)/[multicore](http://cran.r-project.org/web/packages/multicore) package combo. Windows, not so much.) Basically, you tell it how many processors you have, write a loop using the foreach function, and the iterations of the loop run in parallel, using multiple processors. For embarassingly parallel problems like simulations and optimizations and such, if you have 2 processors you can get close to halving the processing time; reduce it to near 25% with 4 processors, and so on. (Whether these are true, independent CPUs or cores within a processor matters a little, but not much.)

You can see some examples in the doSMP vignette, from which I adapted the following example. Suppose you want to bootstrap parameter estimates from a logistic regression using 1000 samples:

```
x

