Rthreads | R Documentation |
Utilties to implement threads programming in R.
rthreadsSetup(nThreads, sharedVars = NULL, mutexNames = NULL,
infoDir = '~/')
rthreadsAtomicInc(sharedV,mtx='mutex0',increm=1)
rthreadsAttachSharedVar(varName,infoDir='~/')
rthreadsInitBarrier()
rthreadsMakeBarrier()
rthreadsMakeSharedVar(varName,nr,nc,infoDir='~/',initVal=NULL)
rthreadsWaitDone()
rthreadsAttachMutex(mutexName,infoDir='~/')
rthreadsBarrier()
rthreadsJoin(infoDir= '~')
rthreadsMakeMutex(mutexName,infoDir='~/')
quickstart()
nThreads |
Number of threads. |
sharedVars |
Quoted names. |
mutexNames |
Quoted names. |
infoDir |
Directory containing the shared objects. |
sharedV |
Quoted name. |
mtx |
Quoted name. |
increm |
Amount to add to shared variable. Can be a vector. |
varName |
Quoted name. |
nr |
Number of rows. |
nc |
Number of columns. |
mutexName |
Quoted name. |
initVal |
Initial value of shared variable. |
One sets up terminal windows, one for each thread. In the first window,
one calls rthreadsSetup
, then rthreadsJoin
in each window.
Shared variables must be of matrix type (a restriction of
bigmemory
). One creates them via rthreadsMakeSharedVariable
in one window (optionally in rthreadsSetup
), then calls
rthreadsAttachSharedVar
in the other windows to share them.
Type 'quickstart()' for detailed examples.
Norm Matloff
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.