parallel.texi
来自「c++经典教材 Blitz++ v0.8」· TEXI 代码 · 共 41 行
TEXI
41 行
While Blitz++ can be used for parallel computing, it was not designedprimarily for this purpose. For this reason, you may want to investigatesome other available libraries, such as POOMA, before choosing to implementa parallel code using Blitz++.@section Blitz++ and thread safety@cindex parallel computing@cindex thread safetyTo enable thread-safety in Blitz++, you need to do one of these things:@findex BZ_THREADSAFE@findex BZ_MUTEX_...@itemize @bullet@findex REENTRANT@item Compile with @code{gcc -pthread}, or @code{CC -mt} under Solaris.(These options define @code{_REENTRANT}, which tells Blitz++ to generatethread-safe code).@item Compile with @code{-DBZ_THREADSAFE}, or @code{#define BZ_THREADSAFE}before including any Blitz++ headers.@end itemizeIn threadsafe mode, Blitz++ array reference counts are safeguarded by amutex. By default, pthread mutexes are used. If you would prefer adifferent mutex implementation, add the appropriate @code{BZ_MUTEX} macrosto @code{<blitz/blitz.h>} and send them to @code{blitz-dev@@oonumerics.org}for incorporation.@cindex locking (thread safety)Blitz++ does not do locking for every array element access; this wouldresult in terrible performance. It is the job of the library user to ensurethat appropriate synchronization is used.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?