From wdunlap at tibco.com  Thu May 12 16:15:54 2016
From: wdunlap at tibco.com (William Dunlap)
Date: Thu, 12 May 2016 07:15:54 -0700
Subject: [Rd] Single-threaded aspect
In-Reply-To: <CAKxd1KPhHhWuMF2Tbc+08uABm6gji=43PT3xTc+0-kdY6t=b2Q@mail.gmail.com>
References: <CAKxd1KPhHhWuMF2Tbc+08uABm6gji=43PT3xTc+0-kdY6t=b2Q@mail.gmail.com>
Message-ID: <CAF8bMcaVJYVC-GCP4qpfQjj=8NJOKweoP+Pn+3ASjWSeDekFpQ@mail.gmail.com>

The R language itself has features that limit how much
mulitthreading/parallel processing can be done.  There are functions with
side effects, such as library(), plot(), runif(), <-, and <<- and there are
no mechanisms to isolate them.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, May 12, 2016 at 5:45 AM, Charles Determan <cdetermanjr at gmail.com>
wrote:

> R Developers,
>
> Could someone help explain what it means that R is single threaded?  I am
> trying to understand what is actually going on inside R when users want to
> parallelize code.  For example, using mclapply or foreach (with some
> backend) somehow allows users to benefit from multiple CPUs.
>
> Similarly there is the RcppParallel package for RMatrix/RVector objects.
> But none of these address the general XPtr objects in Rcpp.  Some readers
> here may recognize my question on SO (
>
> http://stackoverflow.com/questions/37167479/rcpp-parallelize-functions-that-return-xptr
> )
> where I was curious about parallel calls to C++/Rcpp functions that return
> XPtr objects.  I am being a little more persistent here as this limitation
> provides a very hard stop on the development on one of my packages that
> heavily uses XPtr objects.  It's not meant to be a criticism or intended to
> be rude, I just want to fully understand.
>
> I am willing to accept that it may be impossible currently but I want to at
> least understand why it is impossible so I can explain to future users why
> parallel functionality is not available.  Which just echos my original
> question, what does it mean that R is single threaded?
>
> Kind Regards,
> Charles
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



[Rd] Single-threaded aspect
William Dunlap