[R-pkg-devel] multithreading in packages

Vladimir Dergachev vo|ody@ @end|ng |rom m|nd@pr|ng@com
Fri Oct 8 03:58:08 CEST 2021


  I am considering adding multithreading support in my package, and would 
appreciate any suggestions/comments/opinions on what is the right way to 
do this.

   * My understanding from reading documentation and source code is that 
there is no dedicated support in R yet, but there are packages that use 
multithreading. Are there any plans for multithreading support in future R 
versions ?

   * pthread or openmp ? I am particularly concerned about interaction with 
other packages. I have seen that using pthread and openmp libraries 
simultaneously can result in incorrectly pinned threads.

   * control of maximum number of threads. One can default to openmp 
environment variable, but these might vary between openmp implementations.

thank you very much

Vladimir Dergachev



More information about the R-package-devel mailing list