
Chapter 5
The Shared-Memory
Paradigm: C Level
As mentioned in Section 1.1, an increasingly common usage of R is “R+X,”
in which coding is done in a combination of R and some other language.
From the beginning of R, a common example has involved the C/C++
languages playing the role of X, and this is especially important for parallel
computation.
The standard method for programming directly on multicore machines, is to
use threads libraries, which are available for all modern operating systems.
On Unix-family systems (Linux, Mac), for example, the pthreads library
is quite popular.
The programmer calls functions in the threads library. For instance, one