[Rd] R thread safe

Rune Schjellerup Philosof rphilosof at health.sdu.dk
Wed Mar 18 13:59:13 CET 2009


Duncan Temple Lang wrote (Mon Nov 7 22:35:22 CET 2005):
>R is not yet thread safe.
>We are working on it, and I hope to make some progress before
>the end of the year.  (This one even!)
>
> D.

How is this going along?

For some things it would be simpler to use threads compared to
processes, to avoid the added complexity of passing the results back to
a master process.

With the emerging multicore processors it is essential that users can
easily make use of them.

A simple example of use:
  data1 <- data2 <- matrix(0, r, c)
  dataFiller <- function(i) {
   tmp <- someCalculation(i)
   data1[, i] <<- tmp$result1
   data2[, i] <<- tmp$result2
  }
  runParallelInThreads(1:c, dataFiller)

If this can be done almost as fast and simple with processes, for
instance using the multicore package, then I think it needs to be better
documented.

-- 
Regards
Rune Schjellerup Philosof



More information about the R-devel mailing list