<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Chapter 21. Thread</title> <link rel="stylesheet" href="boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)"> <link rel="prev" href="string_algo/credits.html" title="Credits"> <link rel="next" href="thread/changes.html" title="Changes since boost 1.40"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td> <td align="center"><a href="../../index.html">Home</a></td> <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a> </div> <div class="chapter" title="Chapter 21. Thread"> <div class="titlepage"><div> <div><h2 class="title"> <a name="thread"></a>Chapter 21. Thread</h2></div> <div><div class="authorgroup"><div class="author"><h3 class="author"> <span class="firstname">Anthony</span> <span class="surname">Williams</span> </h3></div></div></div> <div><p class="copyright">Copyright © 2007 -8 Anthony Williams</p></div> <div><div class="legalnotice" title="Legal Notice"> <a name="id1757377"></a><p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></div> </div></div> <div class="toc"> <p><b>Table of Contents</b></p> <dl> <dt><span class="section"><a href="thread.html#thread.overview"> Overview</a></span></dt> <dt><span class="section"><a href="thread/changes.html"> Changes since boost 1.40</a></span></dt> <dt><span class="section"><a href="thread/thread_management.html"> Thread Management</a></span></dt> <dd><dl> <dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.thread"> Class <code class="computeroutput"><span class="identifier">thread</span></code></a></span></dt> <dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.this_thread"> Namespace <code class="computeroutput"><span class="identifier">this_thread</span></code></a></span></dt> <dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.threadgroup"> Class <code class="computeroutput"><span class="identifier">thread_group</span></code></a></span></dt> </dl></dd> <dt><span class="section"><a href="thread/synchronization.html"> Synchronization</a></span></dt> <dd><dl> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_concepts"> Mutex Concepts</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.locks"> Lock Types</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.lock_functions"> Lock functions</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_types"> Mutex Types</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.condvar_ref"> Condition Variables</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.once"> One-time Initialization</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.barriers"> Barriers</a></span></dt> <dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.futures"> Futures</a></span></dt> </dl></dd> <dt><span class="section"><a href="thread/thread_local_storage.html">Thread Local Storage</a></span></dt> <dd><dl><dt><span class="section"><a href="thread/thread_local_storage.html#thread.thread_local_storage.thread_specific_ptr"> Class <code class="computeroutput"><span class="identifier">thread_specific_ptr</span></code></a></span></dt></dl></dd> <dt><span class="section"><a href="thread/time.html"> Date and Time Requirements</a></span></dt> <dd><dl> <dt><span class="section"><a href="thread/time.html#thread.time.system_time"> Typedef <code class="computeroutput"><span class="identifier">system_time</span></code></a></span></dt> <dt><span class="section"><a href="thread/time.html#thread.time.get_system_time"> Non-member function <code class="computeroutput"><span class="identifier">get_system_time</span><span class="special">()</span></code></a></span></dt> </dl></dd> <dt><span class="section"><a href="thread/acknowledgements.html"> Acknowledgments</a></span></dt> </dl> </div> <div class="section" title="Overview"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="thread.overview"></a><a class="link" href="thread.html#thread.overview" title="Overview"> Overview</a> </h2></div></div></div> <p> <span class="bold"><strong>Boost.Thread</strong></span> enables the use of multiple threads of execution with shared data in portable C++ code. It provides classes and functions for managing the threads themselves, along with others for synchronizing data between the threads or providing separate copies of data specific to individual threads. </p> <p> The <span class="bold"><strong>Boost.Thread</strong></span> library was originally written and designed by William E. Kempf. This version is a major rewrite designed to closely follow the proposals presented to the C++ Standards Committee, in particular <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html" target="_top">N2497</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html" target="_top">N2320</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2184.html" target="_top">N2184</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2139.html" target="_top">N2139</a>, and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html" target="_top">N2094</a> </p> <p> In order to use the classes and functions described here, you can either include the specific headers specified by the descriptions of each class or function, or include the master thread library header: </p> <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> </pre> <p> which includes all the other headers in turn. </p> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer"></div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a> </div> </body> </html>