2
While Blitz++ can be used for parallel computing, it was not designed
3
primarily for this purpose. For this reason, you may want to investigate
4
some other available libraries, such as POOMA, before choosing to implement
5
a parallel code using Blitz++.
7
@section Blitz++ and thread safety
8
@cindex parallel computing
12
To enable thread-safety in Blitz++, you need to do one of these things:
20
@item Compile with @code{gcc -pthread}, or @code{CC -mt} under Solaris.
21
(These options define @code{_REENTRANT}, which tells Blitz++ to generate
24
@item Compile with @code{-DBZ_THREADSAFE}, or @code{#define BZ_THREADSAFE}
25
before including any Blitz++ headers.
29
In threadsafe mode, Blitz++ array reference counts are safeguarded by a
30
mutex. By default, pthread mutexes are used. If you would prefer a
31
different mutex implementation, add the appropriate @code{BZ_MUTEX} macros
32
to @code{<blitz/blitz.h>} and send them to @code{blitz-dev@@oonumerics.org}
35
@cindex locking (thread safety)
37
Blitz++ does not do locking for every array element access; this would
38
result in terrible performance. It is the job of the library user to ensure
39
that appropriate synchronization is used.