Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R - Concurrent Programming

Tags:

r

Is it possible to do concurrent programming in R

For example, running 2 functions with while(TRUE) loops concurrently.

like image 655
SilverSpoon Avatar asked Dec 12 '22 04:12

SilverSpoon


1 Answers

The snow, Rmpi, and pvm packages have supported this for almost a decade, initially across computers and also on a multi-cpu or multi-core machine.

The multicore package added a the ability to do this on multi-core machines.

Since R 2.14.0, the parallel package has bundled parts of snow and multicore in the basic R distribution. This may be your best starting point now.

A few parts of R itself also use multi-threaded programming, but that approach is limited due to some architectural constraints that are unlikely to be lifted.

We wrote a survey paper on parallel programming with R a few years ago which is still relevant.

like image 132
Dirk Eddelbuettel Avatar answered Jan 03 '23 01:01

Dirk Eddelbuettel