diff options
Diffstat (limited to 'libstdc++-v3/docs/html/faq')
-rw-r--r-- | libstdc++-v3/docs/html/faq/index.html | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html index e353a1f..ff6cd65 100644 --- a/libstdc++-v3/docs/html/faq/index.html +++ b/libstdc++-v3/docs/html/faq/index.html @@ -1052,14 +1052,26 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff <hr /> <h2><a name="5_6">5.6 Is libstdc++ thread-safe?</a></h2> - <p>libstdc++ strives to be thread-safe when all of the following + <p>The library strives to be thread-safe when all of the following conditions are met: </p> <ul> <li>The system's libc is itself thread-safe,</li> - <li><code>gcc -v</code> reports a thread model other than 'single',</li> - <li>[pre-3.3 only] a non-generic implementation of atomicity.h - exists for the architecture in question.</li> + <li>The compiler in use reports a thread model other than 'single'. This can be tested via output from <code>gcc -v</code>. Multi-thread capable versions of gcc output something like this: +<pre> +%gcc -v +Using built-in specs. +... +Thread model: posix +gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) +</pre> + +<p>Look for "Thread model" lines that aren't equal to "single."</p> + </li> + <li>Requisite command-line flags are used for atomic operations and threading. Examples of this include <code>-pthread</code> and <code>-march=native</code>, although specifics vary depending on the host environment. See <a href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html">Machine Dependent Options</a>.</li> + <li>An implementation of atomicity.h functions + exists for the architecture in question. See the internals documentation for more <a href="../ext/concurrence.html">details</a>.</li> + </ul> <p>The user-code must guard against concurrent method calls which may access any particular library object's state. Typically, the |