Rparallelism

See this original blog

foreach

## [[1]]
## [1] 1
## 
## [[2]]
## [1] 1.414214
## 
## [[3]]
## [1] 1.732051
## [[1]]
## [1] 1
## 
## [[2]]
## [1] 1.414214
## 
## [[3]]
## [1] 1.732051
## [1] 1.000000 1.414214 1.732051
## [1] 1.000000 1.414214 1.732051

bigstatsr lib

##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,]    2    3    4    5    6    7    8    9
## [2,]    3    4    5    6    7    8    9   10
## [3,]    4    5    6    7    8    9   10   11
## [4,]    5    6    7    8    9   10   11   12
## [5,]    6    7    8    9   10   11   12   13

File lock

So each process uses some lock to perform its incrementation so that the data can???t be changed by some other process in the meantime.

## [1] 0
## NULL

cores to use

## [1] 4
## [1] 2