R friendly multi-threading in C++

11/01/2018
by   Thomas Nagler, et al.
0

Calling multi-threaded C++ code from R has its perils. Since the R interpreter is single-threaded, one must not check for user interruptions or print to the R console from multiple threads. One can, however, synchronize with R from the main thread. The R package RcppThread (current version 0.5.0) contains a header only C++ library for thread safe communication with R that exploits this fact. It includes C++ classes for threads, a thread pool, and parallel loops that routinely synchronize with R. This article explains the package's functionality and gives examples of its usage. The the synchronization mechanism may also apply to other threading frameworks. Benchmarks suggest that, although synchronization causes overhead, the parallel abstractions of RcppThread are competitive with other popular libraries in typical scenarios encountered in statistical computing.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/11/2022

Code Librarian: A Software Package Recommendation System

The use of packaged libraries can significantly shorten the software dev...
research
11/15/2017

Hydra: a C++11 framework for data analysis in massively parallel platforms

Hydra is a header-only, templated and C++11-compliant framework designed...
research
11/01/2022

Algebra of N-event synchronization

We have previously defined synchronization (Gomez, E. and K. Schubert 20...
research
04/11/2020

A Study of Single and Multi-device Synchronization Methods in Nvidia GPUs

GPUs are playing an increasingly important role in general-purpose compu...
research
03/16/2023

cito: An R package for training neural networks using torch

1. Deep neural networks (DNN) have become a central class of algorithms ...
research
12/07/2019

MoebInv: C++ libraries for manipulations in non-Euclidean geometry

The introduced package MoebInv contains two CPP libraries for symbolic, ...

Please sign up or login with your details

Forgot password? Click here to reset