首页    期刊浏览 2024年11月30日 星期六
登录注册

文章基本信息

  • 标题:R-Friendly Multi-Threading in C
  • 本地全文:下载
  • 作者:Thomas Nagler
  • 期刊名称:Journal of Statistical Software
  • 印刷版ISSN:1548-7660
  • 电子版ISSN:1548-7660
  • 出版年度:2021
  • 卷号:97
  • 期号:1
  • 页码:1-18
  • DOI:10.18637/jss.v097.c01
  • 出版社:University of California, Los Angeles
  • 摘要: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 1.0.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 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.
  • 关键词:R; C ; parallel; thread; concurrency.
  • 其他关键词:R;C ;parallel;thread;concurrency
国家哲学社会科学文献中心版权所有