On Mon, 28 Aug 2000, Vlad wrote:> Hello, > I checked mail list archives and this topic came up before in March '99 > (about ability of R to multithread). > At that time rossini at biostat.washington.edu (Tom Rossini)(?Tony Rossini). He's not doing it.> suggested to check his web page in a few month as it was on > his list to-do. I checked but the web page is not valid. > > I wanted to know if in general progress has been made in the area, > or if it is planned. > I was also wondering if it is possible to use R from a C++ program. > Specifically if it is possible to ask R to run a given R-program > from withing a posix thread (on linux) without providing a Mutex that > would serialise access to R process.No. You need to make sure that only one thread calls R, which means having some sort of handler to queue the commands. This is what we do for Tcl/Tk events and (I believe) for the Windows GUI. I don't think there are any plans to thoroughly multithread R. Having a few bits of it run on separate threads has been suggested, but multithreading the whole thing would be difficult.> I am asking because for performance reason, I would like > to read and manipulate sample data in a multithreaded > C++ program, while living the stat. analysis for R. (I do not > want to format data, dump it in to a file and then read it back from R. > The disk (I/O) activities in such approach is too time consuming. I > would > however use shared memory regions, if R allows to read data from there.)You can read and write directly into R objects (documented in "Writing R Extensions") as long as you are careful about the garbage collector.> Unrelated question: is the above possible with Splus v. 5?This is not the best place to ask this question. I think the answer is no. Duncan Temple Lang got S version 4 to multithread (or nearly?) but I don't think S-PLUS ever has. -thomas Thomas Lumley Assistant Professor, Biostatistics University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "V" == Vlad <pvlad at bigfoot.com> writes:V> Hello, I checked mail list archives and this topic came up V> before in March '99 (about ability of R to multithread). At V> that time rossini at biostat.washington.edu (Tom Rossini) V> suggested to check his web page in a few month as it was on his V> list to-do. I believe that some of the concerns that you have can be addressed by a design via the Omegahat CORBA interface for R. V> Unrelated question: is the above possible with Splus v. 5? (I V> did review the R FAQ but did not find this as one of the V> differences) Nope. I know there was once a variant of S4 with threads, but I'm not sure what the status there was (last I tried, which was last spring, it was broken, but for various reasons, see below, not really worth following up on for me at the time. It's really a design issue. What I was interested at the time was more of a PVM/MPI type interface; however, I've shown (at least to myself) that a redesign of the problem will solve most of the problems I was looking at using threads to solve. (i.e. CORBA style approaches). I'm sure Duncan can comment more, as I believe he's had a similar revelation (and in fact started me down towards that conclusion). I know that some people are looking at threading R, but it's not clear to me why that would be a win-win solution. As far as threading within R, I'm sure some of the R-core people could discuss this further, as well... My advice is to step back and look at the problem and the design you are contemplating, and evaluate numerous solutions. Then ask yourself how much (realistically, i.e. actually code a toy case out in Java or pthreads/C[*]) and see what the gain is. It might be aesthetic, it might be "coolness", but it's not clear that the gain will be in fact practical without the particular experiments being done. Threads and parallelization are nice, but aren't a uniformly positive increase. Not that it wouldn't be cool, but...? best, -tony (On vacation, until Sept 1). -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics BlindGlobe Networks (home/default) rossini at blindglobe.net UW Biostat/Center for AIDS Research rossini at biostat.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org CFAR: M/F: 206-731-3647 (fax=3694) | Email is far better than phone FHCRC: Tu/W: 206-667-7025 (fax=4812) | Voicemail is pretty sketchy UW: Th: 206-543-1044 (fax=3286) | Change last 4 digits of phone for fax -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello, I checked mail list archives and this topic came up before in March '99 (about ability of R to multithread). At that time rossini at biostat.washington.edu (Tom Rossini) suggested to check his web page in a few month as it was on his list to-do. I checked but the web page is not valid. I wanted to know if in general progress has been made in the area, or if it is planned. I was also wondering if it is possible to use R from a C++ program. Specifically if it is possible to ask R to run a given R-program from withing a posix thread (on linux) without providing a Mutex that would serialise access to R process. If R does not use any global variables /shared memory or other global resources this would be possible -- else it will not be. I am asking because for performance reason, I would like to read and manipulate sample data in a multithreaded C++ program, while living the stat. analysis for R. (I do not want to format data, dump it in to a file and then read it back from R. The disk (I/O) activities in such approach is too time consuming. I would however use shared memory regions, if R allows to read data from there.) Unrelated question: is the above possible with Splus v. 5? (I did review the R FAQ but did not find this as one of the differences) Thanks in advance, Vlad -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._