concurrency_extensions.xml: Update documentation on atomics.
authorJonathan Wakely <jwakely@redhat.com>
Mon, 20 Apr 2015 11:07:50 +0000 (12:07 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 20 Apr 2015 11:07:50 +0000 (12:07 +0100)
* doc/xml/manual/concurrency_extensions.xml: Update documentation
on atomics.
* doc/xml/manual/using.xml: Likewise. Improve markup.
* doc/html/*: Regenerate.

From-SVN: r222230

libstdc++-v3/ChangeLog
libstdc++-v3/doc/html/index.html
libstdc++-v3/doc/html/manual/ext_concurrency.html
libstdc++-v3/doc/html/manual/ext_concurrency_impl.html
libstdc++-v3/doc/html/manual/extensions.html
libstdc++-v3/doc/html/manual/index.html
libstdc++-v3/doc/html/manual/using.html
libstdc++-v3/doc/html/manual/using_concurrency.html
libstdc++-v3/doc/html/manual/using_macros.html
libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
libstdc++-v3/doc/xml/manual/using.xml

index 22113d5..a82dd92 100644 (file)
@@ -1,3 +1,10 @@
+2015-04-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       * doc/xml/manual/concurrency_extensions.xml: Update documentation
+       on atomics.
+       * doc/xml/manual/using.xml: Likewise. Improve markup.
+       * doc/html/*: Regenerate.
+
 2015-04-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * scripts/extract_symvers.pl: Ignore elfdump error output.
index 536d931..feaa28c 100644 (file)
          Text <code class="function">modify</code> Up
        </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
          Text <code class="function">modify</code> Down
-       </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="manual/policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="manual/ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="manual/ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="manual/ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/appendix.html">IV. 
+       </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="manual/policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="manual/ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="manual/ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="manual/ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/appendix.html">IV. 
   Appendices
 </a></span></dt><dd><dl><dt><span class="appendix"><a href="manual/appendix_contributing.html">A. 
   Contributing
index ad3eac4..688bdd0 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 30. Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 29. Demangling" /><link rel="next" href="ext_concurrency_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
   Extensions
   
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code>
 contains all the higher-level
 constructs for playing with threads. In contrast to the atomics layer,
 the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
index 84db3da..bb5d144 100644 (file)
@@ -1,12 +1,20 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Built-in Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
 implemented via compiler intrinsics (if the underlying host is
 capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred.  However, as
 the compiler builtins for atomics are not universally implemented,
 using them directly is problematic, and can result in undefined
-function calls. (An example of an undefined symbol from the use
+function calls.
+</p><p>Prior to GCC 4.7 the older <code class="code">__sync</code> intrinsics were used.
+An example of an undefined symbol from the use
 of <code class="code">__sync_fetch_and_add</code> on an unsupported host is a
-missing reference to <code class="code">__sync_fetch_and_add_4</code>.)
+missing reference to <code class="code">__sync_fetch_and_add_4</code>.
+</p><p>Current releases use the newer <code class="code">__atomic</code> intrinsics,
+which are implemented by library calls if the hardware doesn't support them.
+Undefined references to functions like
+<code class="code">__atomic_is_lock_free</code> should be resolved by linking to
+<code class="filename">libatomic</code>, which is usually
+installed alongside libstdc++.
 </p><p>In addition, on some hosts the compiler intrinsics are enabled
 conditionally, via the <code class="code">-march</code> command line flag. This makes
 usage vary depending on the target hardware and the flags used during
index 435e0b3..ac3e1a9 100644 (file)
@@ -68,4 +68,4 @@
          Text <code class="function">modify</code> Up
        </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
          Text <code class="function">modify</code> Down
-       </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_preface.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Interacting with C </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
\ No newline at end of file
+       </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_preface.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Interacting with C </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
\ No newline at end of file
index 7141dc5..26f6233 100644 (file)
          Text <code class="function">modify</code> Up
        </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
          Text <code class="function">modify</code> Down
-       </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="appendix.html">IV. 
+       </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_ack.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="appendix.html">IV. 
   Appendices
 </a></span></dt><dd><dl><dt><span class="appendix"><a href="appendix_contributing.html">A. 
   Contributing
index 9c721ed..dff5192 100644 (file)
@@ -3,12 +3,18 @@
   Introduction
   
 </th><td width="20%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"></a>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.flags"></a>Command Options</h2></div></div></div><p>
-      The set of features available in the GNU C++ library is shaped
-      by
+      The set of features available in the GNU C++ library is shaped by
       several <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html" target="_top">GCC
       Command Options</a>. Options that impact libstdc++ are
       enumerated and detailed in the table below.
     </p><p>
       By default, <span class="command"><strong>g++</strong></span> is equivalent to  <span class="command"><strong>g++ -std=gnu++98</strong></span>. The standard library also defaults to this dialect.
-    </p><div class="table"><a id="table.cmd_options"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++11 &lt;thread&gt;, &lt;future&gt;,
-      &lt;mutex&gt;, or &lt;condition_variable&gt;.</td></tr><tr><td align="left"><code class="literal">-fopenmp</code></td><td align="left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
\ No newline at end of file
+    </p><div class="table"><a id="table.cmd_options"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++11
+        <code class="filename">&lt;thread&gt;</code>,
+        <code class="filename">&lt;future&gt;</code>,
+        <code class="filename">&lt;mutex&gt;</code>,
+        or <code class="filename">&lt;condition_variable&gt;</code>.
+      </td></tr><tr><td align="left"><code class="literal">-latomic</code></td><td align="left">Linking to <code class="filename">libatomic</code>
+        is required for some uses of ISO C++11
+        <code class="filename">&lt;atomic&gt;</code>.
+      </td></tr><tr><td align="left"><code class="literal">-fopenmp</code></td><td align="left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
\ No newline at end of file
index 5370fc3..ee3d8f5 100644 (file)
       all required macros to a compilation (if any such flags are
       required then you must provide the flag for all compilations not
       just linking) and link-library additions and/or replacements at
-      link time.  The documentation is weak.  Here is a quick summary
-      to display how ad hoc this is: On Solaris, both -pthreads and
-      -threads (with subtly different meanings) are honored.  
-      On GNU/Linux x86, -pthread is honored.  On FreeBSD,
-      -pthread is honored.  Some other ports use other switches.
-      AFAIK, none of this is properly documented anywhere other than
-      in ``gcc -dumpspecs'' (look at lib and cpp entries).
+      link time.  The documentation is weak.  On several targets (including
+      GNU/Linux, Solaris and various BSDs) -pthread is honored.
+      Some other ports use other switches.
+      This is not well documented anywhere other than
+      in "gcc -dumpspecs" (look at the 'lib' and 'cpp' entries).
+   </p><p>
+     Some uses of <code class="classname">std::atomic</code> also require linking
+     to <code class="filename">libatomic</code>.
    </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.concurrency.thread_safety"></a>Thread Safety</h3></div></div></div><p>
 In the terms of the 2011 C++ standard a thread-safe program is one which
 does not perform any conflicting non-atomic operations on memory locations
@@ -59,11 +60,16 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
         Requisite command-line flags are used for atomic operations
         and threading. Examples of this include <code class="code">-pthread</code>
         and <code class="code">-march=native</code>, although specifics vary
-        depending on the host environment. See <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html" target="_top">Machine
+        depending on the host environment. See
+        <a class="link" href="using.html#manual.intro.using.flags" title="Command Options">Command Options</a> and
+        <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html" target="_top">Machine
         Dependent Options</a>.
        </p></li><li class="listitem"><p>
-          An implementation of atomicity.h functions
-          exists for the architecture in question. See the internals documentation for more <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">details</a>.
+          An implementation of the
+          <code class="filename">atomicity.h</code> functions
+          exists for the architecture in question. See the
+          <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">internals
+          documentation</a> for more details.
        </p></li></ul></div><p>The user code must guard against concurrent function calls which
          access any particular library object's state when one or more of
          those accesses modifies the state. An object will be modified by
index 44acbb7..bac3f36 100644 (file)
@@ -7,8 +7,9 @@
       file <code class="filename">c++config.h</code>, which
       is generated during the libstdc++ configuration and build
       process. This file is then included when needed by files part of
-      the public libstdc++ API, like &lt;ios&gt;. Most of these macros
-      should not be used by consumers of libstdc++, and are reserved
+      the public libstdc++ API, like
+      <code class="filename">&lt;ios&gt;</code>. Most of these
+      macros should not be used by consumers of libstdc++, and are reserved
       for internal implementation use. <span class="emphasis"><em>These macros cannot
       be redefined</em></span>.
    </p><p>
       general public.
    </p><p>Below is the macro which users may check for library version
       information. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">__GLIBCXX__</code></span></dt><dd><p>The current version of
-    libstdc++ in compressed ISO date format, form of an unsigned
+    libstdc++ in compressed ISO date format, as an unsigned
     long. For details on the value of this particular macro for a
-    particular release, please consult this <a class="link" href="abi.html" title="ABI Policy and Guidelines">
-    document</a>.
+    particular release, please consult the <a class="link" href="abi.html" title="ABI Policy and Guidelines">
+    ABI Policy and Guidelines</a> appendix.
     </p></dd></dl></div><p>Below are the macros which users may change with #define/#undef or
       with -D/-U compiler flags.  The default state of the symbol is
       listed.</p><p><span class="quote">“<span class="quote">Configurable</span>”</span> (or <span class="quote">“<span class="quote">Not configurable</span>”</span>) means
       that the symbol is initially chosen (or not) based on
       --enable/--disable options at library build and configure time
-      (documented <a class="link" href="configure.html" title="Configure">here</a>), with the
-      various --enable/--disable choices being translated to
+      (documented in
+      <a class="link" href="configure.html" title="Configure">Configure</a>),
+      with the various --enable/--disable choices being translated to
       #define/#undef).
    </p><p> <acronym class="acronym">ABI</acronym> means that changing from the default value may
-  mean changing the <acronym class="acronym">ABI</acronym> of compiled code. In other words, these
-  choices control code which has already been compiled (i.e., in a
+  mean changing the <acronym class="acronym">ABI</acronym> of compiled code. In other words,
+  these choices control code which has already been compiled (i.e., in a
   binary such as libstdc++.a/.so).  If you explicitly #define or
   #undef these macros, the <span class="emphasis"><em>headers</em></span> may see different code
   paths, but the <span class="emphasis"><em>libraries</em></span> which you link against will not.
        <code class="code">--enable-concept-checks</code>.  When defined, performs
        compile-time checking on certain template instantiations to
        detect violations of the requirements of the standard.  This
-       is described in more detail <a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">here</a>.
+       is described in more detail in
+       <a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">Compile Time Checks</a>.
       </p></dd><dt><span class="term"><code class="code">_GLIBCXX_DEBUG</code></span></dt><dd><p>
        Undefined by default. When defined, compiles user code using
-    the <a class="link" href="debug_mode.html" title="Chapter 17. Debug Mode">debug mode</a>.
+       the <a class="link" href="debug_mode.html" title="Chapter 17. Debug Mode">debug mode</a>.
       </p></dd><dt><span class="term"><code class="code">_GLIBCXX_DEBUG_PEDANTIC</code></span></dt><dd><p>
        Undefined by default. When defined while compiling with
-    the <a class="link" href="debug_mode.html" title="Chapter 17. Debug Mode">debug mode</a>, makes
-    the debug mode extremely picky by making the use of libstdc++
-    extensions and libstdc++-specific behavior into errors.
+       the <a class="link" href="debug_mode.html" title="Chapter 17. Debug Mode">debug mode</a>, makes
+       the debug mode extremely picky by making the use of libstdc++
+       extensions and libstdc++-specific behavior into errors.
       </p></dd><dt><span class="term"><code class="code">_GLIBCXX_PARALLEL</code></span></dt><dd><p>Undefined by default. When defined, compiles user code
-    using the <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel
-    mode</a>.
+       using the <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel
+       mode</a>.
       </p></dd><dt><span class="term"><code class="code">_GLIBCXX_PROFILE</code></span></dt><dd><p>Undefined by default. When defined, compiles user code
-    using the <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">profile
-    mode</a>.
+       using the <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">profile
+       mode</a>.
       </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Headers </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Namespaces</td></tr></table></div></body></html>
\ No newline at end of file
index b9bab53..cb79c20 100644 (file)
@@ -187,7 +187,7 @@ host hardware and operating system.
 <section xml:id="manual.ext.concurrency.impl" xreflabel="Implementation"><info><title>Implementation</title></info>
   <?dbhtml filename="ext_concurrency_impl.html"?>
   
-  <section xml:id="manual.ext.concurrency.impl.atomic_fallbacks" xreflabel="Atomic F"><info><title>Using Builtin Atomic Functions</title></info>
+  <section xml:id="manual.ext.concurrency.impl.atomic_fallbacks" xreflabel="Atomic F"><info><title>Using Built-in Atomic Functions</title></info>
     
 
 <para>The functions for atomic operations described above are either
@@ -197,9 +197,21 @@ capable) or by library fallbacks.</para>
 <para>Compiler intrinsics (builtins) are always preferred.  However, as
 the compiler builtins for atomics are not universally implemented,
 using them directly is problematic, and can result in undefined
-function calls. (An example of an undefined symbol from the use
+function calls.
+</para>
+
+<para>Prior to GCC 4.7 the older <code>__sync</code> intrinsics were used.
+An example of an undefined symbol from the use
 of <code>__sync_fetch_and_add</code> on an unsupported host is a
-missing reference to <code>__sync_fetch_and_add_4</code>.)
+missing reference to <code>__sync_fetch_and_add_4</code>.
+</para>
+
+<para>Current releases use the newer <code>__atomic</code> intrinsics,
+which are implemented by library calls if the hardware doesn't support them.
+Undefined references to functions like
+<code>__atomic_is_lock_free</code> should be resolved by linking to
+<filename class="libraryfile">libatomic</filename>, which is usually
+installed alongside libstdc++.
 </para>
 
 <para>In addition, on some hosts the compiler intrinsics are enabled
index 3256c58..f6f615e 100644 (file)
@@ -6,8 +6,7 @@
   <section xml:id="manual.intro.using.flags" xreflabel="Flags"><info><title>Command Options</title></info>
     
     <para>
-      The set of features available in the GNU C++ library is shaped
-      by
+      The set of features available in the GNU C++ library is shaped by
       several <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html">GCC
       Command Options</link>. Options that impact libstdc++ are
       enumerated and detailed in the table below.
 
     <row>
       <entry><literal>-pthread</literal> or <literal>-pthreads</literal></entry>
-      <entry>For ISO C++11 &lt;thread&gt;, &lt;future&gt;,
-      &lt;mutex&gt;, or &lt;condition_variable&gt;.</entry>
+      <entry>For ISO C++11
+        <filename class="headerfile">&lt;thread&gt;</filename>,
+        <filename class="headerfile">&lt;future&gt;</filename>,
+        <filename class="headerfile">&lt;mutex&gt;</filename>,
+        or <filename class="headerfile">&lt;condition_variable&gt;</filename>.
+      </entry>
+    </row>
+
+    <row>
+      <entry><literal>-latomic</literal></entry>
+      <entry>Linking to <filename class="libraryfile">libatomic</filename>
+        is required for some uses of ISO C++11
+        <filename class="headerfile">&lt;atomic&gt;</filename>.
+      </entry>
     </row>
 
     <row>
@@ -779,8 +790,9 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
       file <filename class="headerfile">c++config.h</filename>, which
       is generated during the libstdc++ configuration and build
       process. This file is then included when needed by files part of
-      the public libstdc++ API, like &lt;ios&gt;. Most of these macros
-      should not be used by consumers of libstdc++, and are reserved
+      the public libstdc++ API, like
+      <filename class="headerfile">&lt;ios&gt;</filename>. Most of these
+      macros should not be used by consumers of libstdc++, and are reserved
       for internal implementation use. <emphasis>These macros cannot
       be redefined</emphasis>.
    </para>
@@ -800,10 +812,10 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
       <term><code>__GLIBCXX__</code></term>
       <listitem>
        <para>The current version of
-    libstdc++ in compressed ISO date format, form of an unsigned
+    libstdc++ in compressed ISO date format, as an unsigned
     long. For details on the value of this particular macro for a
-    particular release, please consult this <link linkend="appendix.porting.abi">
-    document</link>.
+    particular release, please consult the <link linkend="appendix.porting.abi">
+    ABI Policy and Guidelines</link> appendix.
     </para>
     </listitem>
     </varlistentry>
@@ -816,14 +828,15 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
    <para><quote>Configurable</quote> (or <quote>Not configurable</quote>) means
       that the symbol is initially chosen (or not) based on
       --enable/--disable options at library build and configure time
-      (documented <link linkend="manual.intro.setup.configure">here</link>), with the
-      various --enable/--disable choices being translated to
+      (documented in
+      <link linkend="manual.intro.setup.configure">Configure</link>),
+      with the various --enable/--disable choices being translated to
       #define/#undef).
    </para>
 
    <para> <acronym>ABI</acronym> means that changing from the default value may
-  mean changing the <acronym>ABI</acronym> of compiled code. In other words, these
-  choices control code which has already been compiled (i.e., in a
+  mean changing the <acronym>ABI</acronym> of compiled code. In other words,
+  these choices control code which has already been compiled (i.e., in a
   binary such as libstdc++.a/.so).  If you explicitly #define or
   #undef these macros, the <emphasis>headers</emphasis> may see different code
   paths, but the <emphasis>libraries</emphasis> which you link against will not.
@@ -854,7 +867,8 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
        <code>--enable-concept-checks</code>.  When defined, performs
        compile-time checking on certain template instantiations to
        detect violations of the requirements of the standard.  This
-       is described in more detail <link linkend="manual.ext.compile_checks">here</link>.
+       is described in more detail in
+       <link linkend="manual.ext.compile_checks">Compile Time Checks</link>.
       </para>
     </listitem></varlistentry>
 
@@ -862,31 +876,31 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
     <listitem>
       <para>
        Undefined by default. When defined, compiles user code using
-    the <link linkend="manual.ext.debug_mode">debug mode</link>.
+       the <link linkend="manual.ext.debug_mode">debug mode</link>.
       </para>
     </listitem></varlistentry>
     <varlistentry><term><code>_GLIBCXX_DEBUG_PEDANTIC</code></term>
     <listitem>
       <para>
        Undefined by default. When defined while compiling with
-    the <link linkend="manual.ext.debug_mode">debug mode</link>, makes
-    the debug mode extremely picky by making the use of libstdc++
-    extensions and libstdc++-specific behavior into errors.
+       the <link linkend="manual.ext.debug_mode">debug mode</link>, makes
+       the debug mode extremely picky by making the use of libstdc++
+       extensions and libstdc++-specific behavior into errors.
       </para>
     </listitem></varlistentry>
     <varlistentry><term><code>_GLIBCXX_PARALLEL</code></term>
     <listitem>
       <para>Undefined by default. When defined, compiles user code
-    using the <link linkend="manual.ext.parallel_mode">parallel
-    mode</link>.
+       using the <link linkend="manual.ext.parallel_mode">parallel
+       mode</link>.
       </para>
     </listitem></varlistentry>
 
     <varlistentry><term><code>_GLIBCXX_PROFILE</code></term>
     <listitem>
       <para>Undefined by default. When defined, compiles user code
-    using the <link linkend="manual.ext.profile_mode">profile
-    mode</link>.
+       using the <link linkend="manual.ext.profile_mode">profile
+       mode</link>.
       </para>
     </listitem></varlistentry>
     </variablelist>
@@ -1248,13 +1262,16 @@ A quick read of the relevant part of the GCC
       all required macros to a compilation (if any such flags are
       required then you must provide the flag for all compilations not
       just linking) and link-library additions and/or replacements at
-      link time.  The documentation is weak.  Here is a quick summary
-      to display how ad hoc this is: On Solaris, both -pthreads and
-      -threads (with subtly different meanings) are honored.  
-      On GNU/Linux x86, -pthread is honored.  On FreeBSD,
-      -pthread is honored.  Some other ports use other switches.
-      AFAIK, none of this is properly documented anywhere other than
-      in ``gcc -dumpspecs'' (look at lib and cpp entries).
+      link time.  The documentation is weak.  On several targets (including
+      GNU/Linux, Solaris and various BSDs) -pthread is honored.
+      Some other ports use other switches.
+      This is not well documented anywhere other than
+      in "gcc -dumpspecs" (look at the 'lib' and 'cpp' entries).
+   </para>
+
+   <para>
+     Some uses of <classname>std::atomic</classname> also require linking
+     to <filename class="libraryfile">libatomic</filename>.
    </para>
 
     </section>
@@ -1305,14 +1322,19 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
         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 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html">Machine
+        depending on the host environment. See
+        <link linkend="manual.intro.using.flags">Command Options</link> and
+        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html">Machine
         Dependent Options</link>.
        </para>
        </listitem>
        <listitem>
         <para>
-          An implementation of atomicity.h functions
-          exists for the architecture in question. See the internals documentation for more <link linkend="internals.thread_safety">details</link>.
+          An implementation of the
+          <filename class="headerfile">atomicity.h</filename> functions
+          exists for the architecture in question. See the
+          <link linkend="internals.thread_safety">internals
+          documentation</link> for more details.
        </para>
        </listitem>