~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to doc/parallel.texi

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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++.
 
6
 
 
7
@section Blitz++ and thread safety
 
8
@cindex parallel computing
 
9
 
 
10
@cindex thread safety
 
11
 
 
12
To enable thread-safety in Blitz++, you need to do one of these things:
 
13
 
 
14
@findex BZ_THREADSAFE
 
15
@findex BZ_MUTEX_...
 
16
 
 
17
@itemize @bullet
 
18
 
 
19
@findex REENTRANT
 
20
@item  Compile with @code{gcc -pthread}, or @code{CC -mt} under Solaris.
 
21
(These options define @code{_REENTRANT}, which tells Blitz++ to generate
 
22
thread-safe code).
 
23
 
 
24
@item  Compile with @code{-DBZ_THREADSAFE}, or @code{#define BZ_THREADSAFE}
 
25
before including any Blitz++ headers.
 
26
 
 
27
@end itemize
 
28
 
 
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}
 
33
for incorporation.
 
34
 
 
35
@cindex locking (thread safety)
 
36
 
 
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.
 
40