Learn R Programming

bigmemory (version 3.12)

rw.mutex, attach.rw.mutex: Mutual exclusion functionality for shared memory matrices in package ``bigmemory''

Description

These functions provide additional read/write mutexes (mutual exclusions) for use with big.matrix objects in shared memory (class big.matrix of bigmemory). They are probably unnecessary for most users.

Usage

rw.mutex()
attach.rw.mutex(mutexId)
rlock(x)
rwlock(x)
unlock(x)

Arguments

mutexId
the shared memory key for the mutex.
x
an object of type rw.mutex.

Value

  • A new instance of type rw.mutex is returned.

Details

Mutexes are provided with every shared matrix (including file-backed matrices) and are managed transparently by the various functions provided for big.matrix objects (mwhich, for example). However, the user may create an additional layer of mutexes using these functions. This may be important in certain shared memory applications. Note that describe should be used to retrieve the rw.mutex information. Mutexes will be stripped out of bigmemory in versions 4.0 and beyond, leaving them available (optionally) to the user in a new package, synchronicity, in the Fall of 2009. This is largely for performance reasons with bigmemory, where the vast majority of shared memory work is read-only or involves algorithms that don't risk read/write conflicts.

References

http://www.boost.org

See Also

big.matrix, shared.big.matrix, filebacked.big.matrix, describe.

Examples

Run this code
# None.

Run the code above in your browser using DataLab