From rphilosof at health.sdu.dk  Wed Mar 18 13:59:13 2009
From: rphilosof at health.sdu.dk (Rune Schjellerup Philosof)
Date: Wed, 18 Mar 2009 13:59:13 +0100
Subject: [Rd]  R thread safe
References: 1131389848.436fa39855a52@webmail.unibas.ch
Message-ID: <49C0F021.8000108@health.sdu.dk>

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



[Rd] R thread safe
Rune Schjellerup Philosof