Up: Parallel Computing   [Contents][Index]


8.1 Blitz++ and thread safety

To enable thread-safety in Blitz++, you need to do one of these things:

In threadsafe mode, Blitz++ array reference counts are safeguarded by a mutex. By default, pthread mutexes are used. If you would prefer a different mutex implementation, add the appropriate BZ_MUTEX macros to <blitz/blitz.h> and send them to blitz-dev@oonumerics.org for incorporation.

Blitz++ does not do locking for every array element access; this would result in terrible performance. It is the job of the library user to ensure that appropriate synchronization is used.