Re: [Rd] Multithreaded code in .Call interface

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sat, 13 Oct 2012 09:57:22 +0100

On 13/10/2012 08:09, Rob Anderson wrote:
> Hi,
>
> I was wondering if it is safe to call R functions and/or R BLAS functions
> from within multithreaded C/C++ code(.Call interface)? It is not in case
> with MATLAB. I was experimenting using pthreads and OpenMP.

Not unless it is documented to be so. (I believe the internal BLAS to be fine, but you could use an external one: although with care if that also uses threads.)

See also 8.1.5 of 'Writing R Extensions'.

> Thanks,
> Rob

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 13 Oct 2012 - 09:01:15 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 16 Oct 2012 - 11:10:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive