Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56762 - in sandbox/interthreads: doc doc/html doc/html/images doc/html/images/callouts libs/interthreads/build libs/interthreads/doc libs/interthreads/doc/html libs/interthreads/doc/html/toward_boost_interthreads libs/interthreads/doc/html/toward_boost_interthreads/appendices libs/interthreads/doc/html/toward_boost_interthreads/examples libs/interthreads/doc/html/toward_boost_interthreads/overview libs/interthreads/doc/html/toward_boost_interthreads/reference libs/interthreads/doc/html/toward_boost_interthreads/users_guide libs/interthreads/doc/reference libs/interthreads/test
From: vicente.botet_at_[hidden]
Date: 2009-10-12 17:42:31


Author: viboes
Date: 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
New Revision: 56762
URL: http://svn.boost.org/trac/boost/changeset/56762

Log:
TBoost.Interthreads:
* Added doc

Added:
   sandbox/interthreads/doc/
   sandbox/interthreads/doc/html/
   sandbox/interthreads/doc/html/boostbook.css (contents, props changed)
   sandbox/interthreads/doc/html/images/
   sandbox/interthreads/doc/html/images/Thumbs.db (contents, props changed)
   sandbox/interthreads/doc/html/images/alert.png (contents, props changed)
   sandbox/interthreads/doc/html/images/blank.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/
   sandbox/interthreads/doc/html/images/callouts/1.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/10.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/11.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/12.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/13.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/14.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/15.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/2.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/3.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/4.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/5.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/6.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/7.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/8.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/9.png (contents, props changed)
   sandbox/interthreads/doc/html/images/callouts/Thumbs.db (contents, props changed)
   sandbox/interthreads/doc/html/images/caution.png (contents, props changed)
   sandbox/interthreads/doc/html/images/draft.png (contents, props changed)
   sandbox/interthreads/doc/html/images/home.png (contents, props changed)
   sandbox/interthreads/doc/html/images/important.png (contents, props changed)
   sandbox/interthreads/doc/html/images/next.png (contents, props changed)
   sandbox/interthreads/doc/html/images/next_disabled.png (contents, props changed)
   sandbox/interthreads/doc/html/images/note.png (contents, props changed)
   sandbox/interthreads/doc/html/images/prev.png (contents, props changed)
   sandbox/interthreads/doc/html/images/prev_disabled.png (contents, props changed)
   sandbox/interthreads/doc/html/images/smiley.png (contents, props changed)
   sandbox/interthreads/doc/html/images/tip.png (contents, props changed)
   sandbox/interthreads/doc/html/images/toc-blank.png (contents, props changed)
   sandbox/interthreads/doc/html/images/toc-minus.png (contents, props changed)
   sandbox/interthreads/doc/html/images/toc-plus.png (contents, props changed)
   sandbox/interthreads/doc/html/images/up.png (contents, props changed)
   sandbox/interthreads/doc/html/images/up_disabled.png (contents, props changed)
   sandbox/interthreads/doc/html/images/warning.png (contents, props changed)
   sandbox/interthreads/doc/html/reference.css (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/
   sandbox/interthreads/libs/interthreads/doc/html/index.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/standalone_HTML.manifest (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/acknowledgements.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/changes.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/implementation.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/rationale.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tests.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tickets.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/todo.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/stm.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/thread_safe_deferred_traces.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview/motivation.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/concepts.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_array_reference.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_extensions_reference.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/bibliography.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/getting_started.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/glosary.html (contents, props changed)
   sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/tutorial.html (contents, props changed)
Text files modified:
   sandbox/interthreads/libs/interthreads/build/Jamfile.v2 | 2
   sandbox/interthreads/libs/interthreads/doc/acknowledgements.qbk | 3
   sandbox/interthreads/libs/interthreads/doc/appendices.qbk | 54 ----
   sandbox/interthreads/libs/interthreads/doc/case_studies.qbk | 304 +++++++++----------------
   sandbox/interthreads/libs/interthreads/doc/changes.qbk | 157 -------------
   sandbox/interthreads/libs/interthreads/doc/concepts.qbk | 457 ----------------------------------------
   sandbox/interthreads/libs/interthreads/doc/getting_started.qbk | 54 ----
   sandbox/interthreads/libs/interthreads/doc/implementation.qbk | 14
   sandbox/interthreads/libs/interthreads/doc/installation.qbk | 22 -
   sandbox/interthreads/libs/interthreads/doc/interthreads.qbk | 2
   sandbox/interthreads/libs/interthreads/doc/introduction.qbk | 414 ------------------------------------
   sandbox/interthreads/libs/interthreads/doc/models.qbk | 256 ----------------------
   sandbox/interthreads/libs/interthreads/doc/overview.qbk | 34 --
   sandbox/interthreads/libs/interthreads/doc/rationale.qbk | 4
   sandbox/interthreads/libs/interthreads/doc/reference.qbk | 76 ------
   sandbox/interthreads/libs/interthreads/doc/reference/thread_decorator.qbk | 22 +
   sandbox/interthreads/libs/interthreads/doc/reference/thread_keep_alive.qbk | 12 +
   sandbox/interthreads/libs/interthreads/doc/reference/thread_specific_shared_ptr.qbk | 11
   sandbox/interthreads/libs/interthreads/doc/tests.qbk | 40 ---
   sandbox/interthreads/libs/interthreads/doc/tickets.qbk | 60 ----
   sandbox/interthreads/libs/interthreads/doc/tutorial.qbk | 4
   sandbox/interthreads/libs/interthreads/doc/users_guide.qbk | 17 -
   sandbox/interthreads/libs/interthreads/test/Jamfile.v2 | 13
   23 files changed, 178 insertions(+), 1854 deletions(-)

Added: sandbox/interthreads/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/interthreads/doc/html/boostbook.css 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,538 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 10pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 10pt;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 10pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+ .toc-main
+ {
+ width: 600;
+ text-align: center;
+ margin: 1pc 1pc 1pc 10%;
+ padding: 2pc 1pc 3pc 1pc;
+ line-height: 0.1;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 120%;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 10pt;
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p
+ {
+ margin: 0em 0em 0.5em 0em;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 1em 0em 1em 2em;
+ font-size: 10pt;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ font-size: 8pt;
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ /* Links */
+ a
+ {
+ color: #0C7445;
+ }
+
+ a:visited
+ {
+ color: #663974;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #E8FBE9; }
+ .dk_grey_bkd { background-color: #A0DAAC; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #E3F9E4;
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ border-collapse: collapse;
+ background-color: #FAFFFB;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }

Added: sandbox/interthreads/doc/html/images/Thumbs.db
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/alert.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/1.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/10.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/11.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/12.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/13.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/14.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/15.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/2.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/3.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/4.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/5.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/6.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/7.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/8.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/9.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/callouts/Thumbs.db
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/home.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/important.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/next.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/note.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/smiley.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/up.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.

Added: sandbox/interthreads/doc/html/reference.css
==============================================================================
--- (empty file)
+++ sandbox/interthreads/doc/html/reference.css 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+PRE.synopsis {
+ background-color: #e0ffff;
+ border: thin solid blue;
+ padding: 1em
+}

Modified: sandbox/interthreads/libs/interthreads/build/Jamfile.v2
==============================================================================
--- sandbox/interthreads/libs/interthreads/build/Jamfile.v2 (original)
+++ sandbox/interthreads/libs/interthreads/build/Jamfile.v2 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -46,7 +46,7 @@
 # <define>BOOST_THREAD_HAS_THREAD_ATTR
     
       <include>../../..
- <include>/boost_1_39_0
+ <include>$BOOST_ROOT
       <link>static:<define>BOOST_INTERTHREADS_BUILD_LIB=1
       <link>shared:<define>BOOST_INTERTHREADS_BUILD_DLL=1
 # <link>shared:<library>/boost/thread//boost_thread/<link>shared

Modified: sandbox/interthreads/libs/interthreads/doc/acknowledgements.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/acknowledgements.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/acknowledgements.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -13,9 +13,6 @@
 
 Thanks also must go to Jochen Heckl for the ideas given respect to the thread_tuple::wait_first implementation.
 
-The Threader|Joiner design is taken from [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1883.pdf N1833 - Preliminary Threading Library Proposal for TR2]
-Many thanks to Kevlin Henney to make evident to me the separation between asynchonous executors, and asynchronous completion tokens.
-
 You can help me to make this library better! Any feedback is very welcome.
 
 [endsect]

Modified: sandbox/interthreads/libs/interthreads/doc/appendices.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/appendices.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/appendices.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -27,87 +27,33 @@
 [section Tasks to do before review]
 
 
-[heading Add an overloading for wait_for_all_in_sequence(ae, f, seq)]
-
-This will be quite useful on recursive algorithms evaluating asynchronously the same function on different parts.
-
- template <
- typename DirectSolver,
- typename Composer,
- typename AsynchronousExecutor,
- typename Input>
- void inplace_solve(AsynchronousExecutor& ae, Problem& input) {
- // if (problem is small)
- if (size(range) < concurrency_threshold) {
- // directly solve problem
- DirectSolver()(input);
- } else {
- // split problem into independent parts
- BOOST_AUTO(partition, partition_view(input));
- // evaluates asynchronously inplace_solve on each element of the partition
- // using the asynchronous executor as scheduler
- wait_for_all_in_sequence(ae, inplace_solve, partition);
- // compose the result in place from subresults
- Composer()(partition);
- }
- }
-
-
-[heading Add polymorphic act and adapters]
-When we need to chain __ACT__ using the fork_after the nature of the __ACT__ can change over time, an why not change also its
-template parameter. So at least we need to make polymorphic every function used by fork_after.
-
-[heading Use set_once to implement wait_for_any]
-The current implementation uses the Boost.Futures wait_for_any to implement this feauture, which add weigth constraint:
-be able to get a future from all the AE/ACT. As AE/ACT wait_for_any evaluates the function itselfs, he can decorate the
-function and signal the first one.]]
-
 [heading Complete the tests]
 
 Even if the current release include some test there is yet a long way before been able to review the library.]]
 
 * change the test so they take less time using locks; conditions and variables.
-* Complete the test for the AE/ACT framework
 * Add test with functions throwing
 * Formalize the tests for thread_decoratoor
 * Formalize the tests for thread_specific_shared_ptr
-* Add tests for asynchronous_executor_decorator, basic_threader_decorator and threader_decorator
 * Add tests for keep alive mechanism
 
 [heading Add more examples]
 
-* Use of the ae/act framework instead of thread_tuples in the Getting Started section.
 * Complete the STM example.
-* A a parallel sort
 * Change the implementation of the file on the async_ostream.
 
-[heading Complete the reference]
-
-* ae/act framework
-
 [heading Change the rational and implementation sections]
 
 [endsect]
 
 [section For later releases]
 
-
-[heading Use Boost.Chrono]
-
 [heading Add C++0x move semantics on compilers supporting it and use the Boost.Move emulation otherwise]
 
 [heading Use C++0x variadic templates on compilers supporting it and use the preprocesor otherwise]
 
 [heading Use C++0x Concepts on compilers supporting them and use the Boost.ConceptCheck or Boost.ConceptTraits otherwise]
 
-[heading Add Message queues]
-Messages queue are the next step concerning the communication between threads on the InterThreads library.]
-
-[heading Add Rendez-vous]
-Concurrent components may interact in different ways: they may access the same objects by, for example,
-executing functions of these objects; or they may communicate directly by executing functions of each other.
-These library will provide the so-called rendezvous mechanism for handling direct communication between active objects.]
-
 [heading Add a daemon controlling all the keep alive controller threads]
 This daemon will send regular keep_alive messages and kill the process when dead.
 

Modified: sandbox/interthreads/libs/interthreads/doc/case_studies.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/case_studies.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/case_studies.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -13,92 +13,6 @@
 
 
 [/==================================]
-[section Parallel sort]
-[/==================================]
-
-Next follows a generic algorithm based on partitioning od a given problem in smaler problems, and compose a solution from the solution of the smaller problems.
-
- template <
- typename DirectSolver,
- typename Composer,
- typename AE,
- typename Range
- >
- void inplace_solve( AE & ae,
- boost::iterator_range<typename boost::range_iterator<Range>::type> range,
- unsigned cutoff );
-
- template <
- typename DirectSolver,
- typename Composer,
- typename AE,
- typename Range
- >
- void inplace_solve( AE & ae,
- boost::iterator_range<typename boost::range_iterator<Range>::type> range,
- unsigned cutoff )
- {
- unsigned size = boost::size(range);
- //std::cout << "<<par_ " << size;
- if ( size <= cutoff) DirectSolver()(range);
- else {
- partition<Range> parts(range, BOOST_PARTS);
-
- // wait_for_all_in_sequence(ae, &inplace_solve<DirectSolver,Composer,AE,Range>, parts);
- std::list<task_type> tasks;
- for (unsigned i=0;i < BOOST_PARTS-1; ++i) {
- task_type tmp(ae.submit(
- boost::bind(
- &inplace_solve<DirectSolver,Composer,AE,Range>,
- boost::ref(ae),
- parts[i],
- cutoff
- )));
- tasks.push_back(tmp);
- }
- inplace_solve<DirectSolver,Composer,AE,Range>(ae, parts[BOOST_PARTS-1], cutoff);
- boost::for_each(tasks, &boost::interthreads::wait_act<task_type>);
- // wait_for_all_in_sequence
-
- Composer()(range);
- }
- }
-
-
-So parallel sort could be
-
- struct sort_fct {
- template<class RandomAccessRange>
- RandomAccessRange& operator()(RandomAccessRange rng) {
- return boost::sort(rng);
- }
- };
-
- struct inplace_merge_fct {
- template<class BidirectionalRange>
- BidirectionalRange&
- operator()( BidirectionalRange rng) {
- return boost::inplace_merge(rng, boost::begin(rng)+(boost::size(rng)/2));
- }
- };
- template <typename AE, typename Range>
- void parallel_sort(AE& ae, Range& range, unsigned cutoff=10000) {
- boost::iterator_range<typename boost::range_iterator<Range>::type> rng(range);
- inplace_solve<sort_fct,inplace_merge_fct,pool_type,Range>( ae, rng, cutoff);
- }
-
-
-[endsect]
-
-[/==================================]
-[section From a single to a multi threaded application]
-[/==================================]
-
-
-
-[endsect]
-
-[/==================================]
 [section Thread safe deferred traces]
 [/==================================]
 
@@ -403,7 +317,7 @@
         BankAccount* checkingAcct_;
         BankAccount* savingsAcct_;
         AccountManager(BankAccount& checking, BankAccount& savings)
- : checkingAcct_(&checking)
+ : checkingAcct_(&checking)
             , savingsAcct_(&savings)
             {}
         void Checking2Savings(int amount) {
@@ -451,104 +365,113 @@
         };
     }
 
-Evidently every operation must be atomic.
+Evidently every operation must be atomic. We use the STM_ATOMIC and STM_END_ATOMIC macors to hide all the transaction complexity
 
     class BankAccount {
         int balance_;
     public:
         void Deposit(unsigned amount) {
- stm::this_tread::atomic _;
- stm::this_tread::make_transactional_ptr(this)->balance_ += amount;
- _.commit();
+ STM_ATOMIC(t) {
+ t.wr_ptr(this)->balance_ += amount;
+ } STM_END_ATOMIC
         }
         // ...
 
     };
 
-How all this works? `stm::this_tread::atomic _;` declares the scope of the variable `_` as an atomic transaction.
-To access this in the current transaction we use `stm::make_transactional_ptr(this)` which return a smart pointer.
-If nothing is said the transaction will be aborted at `_` destruction.
-When everything is ok we need to do a `_.commit()`.
-
-If there is a large use of make_transactional_ptr we can write instead
+How all this works? Let me write what what is begind these macros. These macros use a trick to that ensure that when the statement between both macros succeed the transaction is committed. As the transaction can fail (exception transaction_aborted thrown) we need to reiterate the execution of the statement. So what a user needs to write is something like
 
- {
- stm::this_tread::atomic _;
- stm::this_tread::transactional_ptr<BankAccount> this_ptr(this);
- this_ptr->balance_ += amount;
- _.commit();
+ void Deposit(unsigned amount) {
+ for (stm::transaction t; !t.commited() && t.restart(); t.no_throw_commit()) {
+ try {
+ t.wr_ptr(this)->balance_ += amount;
+ } catch (stm::transaction_aborted&) {}
+ }
         }
 
-or even shorter with the suggar syntax
+1. creation of a new transaction
+2.a if not commited restart the transaction and enter the body of the for (3)
+2.b if commited exit the for.
+3. execute the statement
+4 catch stm::transaction_aborted - if a stm::transaction_aborted is thrown the next commit will fail
+5. do a no_throw commit (2)
+
+Next follows the definition of the STM_ATOMIC and STM_END_ATOMIC macros.
+
+
+To access this in the current transaction we use `t.wr_ptr(this)` which return a smart pointer.
+
+If there is a large use of t.wr_ptr(this) it is better to use a variable
 
         {
- stm::this_tread::atomic_transactional_ptr <BankAccount> this_ptr(this);
- this_ptr->balance_ += amount;
- // other uses of this
- // ...
- this_ptr.commit();
+ STM_ATOMIC(t) {
+ stm::tx_wr_ptr<BankAccount> this_ptr(this,t);
+ this_ptr->balance_ += amount;
+ } STM_END_ATOMIC
         }
 
-The other `BankAccount` functions are coded as expected. Here is the code introducing a `using stm::this_tread;`
-which makes it much more readable.
+The other `BankAccount` functions are coded as expected. Here is the comple code:
 
     class BankAccount {
         int balance_;
- using stm::this_tread;
+ using stm:;
     public:
         void Deposit(unsigned amount) {
- atomic_ptr<BankAccount> this_ptr(this);
- this_ptr->balance_ += amount;
- this_ptr.commit();
+ STM_ATOMIC(t) {
+ t.wr_ptr(this)->balance_ += amount;
+ } STM_END_ATOMIC
         }
         void Withdraw(unsigned amount) {
- atomic_ptr<BankAccount> this_ptr(this);
- this_ptr->balance_ -= amount;
- this_ptr.commit();
+ STM_ATOMIC(t) {
+ t.wr_ptr(this)->balance_ -= amount;
+ }
         }
         int GetBalance() const {
- atomic_ptr<BankAccount> this_ptr(this);
- int res = this_ptr->balance_;
- this_ptr.commit();
- return res;
+ STM_ATOMIC(t) {
+ return make_tx_rd_ptr(this,t)->balance_;
+ } STM_END_ATOMIC
         }
     };
 
 The transfer from accounts is done like:
 
     void Transfer(BankAccount* inA, BankAccount* outA, int amount) {
- using stm::this_tread;
- atomic _;
- make_transactional_ptr(inA)->Withdraw(amount);
- make_transactional_ptr(outA)_>Deposit(amount);
- _.commit();
+ using stm;
+ STM_ATOMIC(t) {
+ t.wr_ptr(inA)->Withdraw(amount);
+ t.wr_ptr(outA)->Deposit(amount);
+ } STM_END_ATOMIC
     }
 
-The core of all this stuff is `stm::this_tread::atomic` and `stm::transactional_ptr<>`.
-`stm::make_transactional_ptr()` and `stm::this_tread::atomic_ptr<>` are defined in terms of `stm::this_tread::atomic` and `stm::transactional_ptr<>`.
+The core of all this stuff is `stm::transaction`, `stm::tx_wr_ptr<>` and `stm::tx_rd_ptr<>`.
+
+The interface of the transaction class is quite simple:
+
+ class transaction {
+ public:
+ bool commit();
+ bool no_throw_commit() throw();
+ void abort();
+
+ template <typename T>
+ shared_ptr<transactional_object_cache<T> > rd_ptr(T* ptr);
+
+ template <typename T>
+ shared_ptr<transactional_object_cache<T> > wr_ptr(T* ptr);
+
+ template <typename T> void delete_memory(T* ptr);
+ template <typename T>
+ shared_ptr<transactional_object_cache<T> > insert_in_new_cache(T* ptr);
 
-Next follows the interface of the atomic class.
+ transaction_state const & state() const;
+ };
 
- namespace stm {
- namespace this_thread {
- class atomic {
- public:
- atomic();
- ~atomic();
- void rollback();
- };
- } // this_transaction
- } // stm
-
-The atomic constructor will construct a
-transaction on the current thread and push it to the stack of nested transactions.
-The atomic destructor will rollback the transaction if not commited and pop the stack of nested transactions.
-We will see later the transaction class.
 
-The transactional_ptr<> smart pointer interface follows:
+
+The smart pointer interfaces follows:
 
     template <typename T>
- class transactional_ptr {
+ class tx_rd_ptr {
     public:
 
         typedef T element_type;
@@ -556,43 +479,45 @@
         typedef T * pointer;
         typedef T& reference;
 
- transactional_ptr(T* p, transaction* tr=0);
- transactional_ptr(T* p, this_thread::atomic& scope);
+ tx_rd_ptr(T* p, transaction& scope);
 
- transactional_ptr(T* p, writable&tag, transaction* tr=0));
- transactional_ptr(T* p, writable&tag, this_thread::atomic& scope);
+ const T* operator->() const;
+ const T& operator*() const;
+ const T * get() const;
+ };
 
- transactional_ptr(T* p, is_new&tag, transaction* tr=0));
- transactional_ptr(T* p, is_new&tag, this_thread::atomic& scope);
 
- const T* operator->() const;
- const T& operator*() const;
- const T * get() const;
+ template <typename T>
+ class tx_wr_ptr {
+ public:
 
- T* operator->();
- T& operator*();
- T * get();
+ typedef T element_type;
+ typedef T value_type;
+ typedef T * pointer;
+ typedef T& reference;
+
+ tx_wr_ptr(T* p, transaction& scope);
 
- void delete_ptr();
+ T* operator->() const;
+ T& operator*() const;
+ T * get() const;
+
+ void delete_ptr();
     };
 
 Let me start with the simple constructor:
 
- transactional_ptr(T* p);
+ tx_wr_ptr(T* p);
 
 This creates a smart pointer pointing to a specific transaction memory of the current transaction.
 
 It contains the classic functions of a smart pointer overloaded with `const` or non `const`.
 
- const T* operator->() const;
- const T& operator*() const;
- const T * get() const;
-
- T* operator->();
- T& operator*();
- T * get();
+ T* operator->() const;
+ T& operator*() const;
+ T * get() const;
 
-By default the `transactional_ptr` points to a read only cache. When we use one of the non const operators,
+`tx_wr_ptr` points to a writable cache. When we use one of the smart pointer operators,
 the pointers points to a upgraded write cache specific to the transaction. In the example
 
             this_ptr->balance_ += amount;
@@ -600,48 +525,45 @@
 the use of `this_ptr->balance_` on the left hand side of the assignement operator requires a non const access,
 so the upgrade to writable is done.
 
-When we know a priori that the pointer contents will be modified we can create it as follows:
-
- void Deposit(unsigned amount) {
- atomic _;
- transactional_ptr<BankAccount> this_ptr(this, writable);
- this_ptr->balance_ += amount;
- _.commit();
- }
-
 Every `new`/`delete` operation on a transaction must be in some way signaled to the transaction service.
-The new created objects would be wrapped by a `transactional_ptr<>` initialized like that;
+The new created objects would be wrapped by a `tx_wr_ptr<>` initialized like that;
 
- transactional_ptr<BankAccount> this_ptr(new BackAccount(), is_new);
+ tx_wr_ptr<BankAccount> this_ptr(new BackAccount(), is_new);
 
-When we want to delete a pointer in a transaction we use `transactional_ptr::delete_ptr`
+When we want to delete a pointer in a transaction we use `tx_wr_ptr::delete_ptr`
 
- transactional_ptr<BankAccount> p_ptr(p, writable);
+ tx_wr_ptr<BankAccount> p_ptr(p, t);
     // ...
     p_ptr.delete_ptr();
+
+or the short-cut
+
+ t.delete_ptr(p);
 
 Before finishing with the `transaction` class let me show you the
 `transactional_object_cache<T>` and its base class `transactional_object_cache_base`.
 
     class transaction {
     public:
- bool commit();
- void rollback();
- void rollback_only();
+ bool commit();
+ bool no_throw_commit();
+ void abort();
 
- template <typename T>
- shared_ptr<transactional_object_cache<T> > read(T* ptr);
+ template <typename T>
+ shared_ptr<transactional_object_cache<T> > read(T* ptr);
 
         template <typename T>
- T* write(T* in);
+ shared_ptr<transactional_object_cache<T> > write(T* ptr);
 
- template <typename T> void delete_memory(T* in);
- template <typename T>
- shared_ptr<transactional_object_cache<T> > insert_in_new_cache(T* ptr);
+ template <typename T> void delete_memory(T* ptr);
+ template <typename T>
+ shared_ptr<transactional_object_cache<T> > insert_in_new_cache(T* ptr);
 
- transaction_state const & state() const;
+ transaction_state const & state() const;
     };
 
+
+
 [endsect]
 
 [endsect]

Modified: sandbox/interthreads/libs/interthreads/doc/changes.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/changes.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/changes.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -7,93 +7,18 @@
 
 [section:changes Appendix A: History]
 
-[section [*Version 0.4.3, May 9, 2009] Adaptation to Boost 1.39
-[endsect]
-
-[section [*Version 0.4.2, Mars 9, 2009] Adaptation to the Boost.ThreadPoold Version 0.23]
+[section [*Version 0.1.3, Mars 29, 2009] Extraction of the Asynchonous Executor framework]
 
 [*New Features:]
 
-* Adaptation to the Boost.ThreadPoold Version 0.21
+* Extraction of the Asynchonous Executor framework
 
 [endsect]
-[section [*Version 0.4.1, Mars 1, 2009] Adaptation to the Boost.ThreadPoold Version 0.21 + Scoped forking + Parallel sort]
-
-[*New Features:]
-
-* Adaptation to the Boost.ThreadPoold Version 0.21
-
-* Scoped forking: In [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html N2802: A plea to reconsider detach-on-destruction for thread objects]
-Hans-J. Boehm explain why is detaching on destruction so dangerous and gives two solutions: 1) replace the call to detach by a join, 2) replace by a terminate call. The library provides the following classes
-
-* a RAII scoped_join which will join the assocaited act on the destructor if not already joined,
-
- basic_threader ae;
- BOOST_AUTO(act,bith::fork(ae, simple_thread));
- scoped_join<BOOST_TYPEOF(act)> j(act);
-
-* a RAII scoped_terminate which will call to teminate on the destructor if not already joined,
-
- basic_threader ae;
- BOOST_AUTO(act,bith::fork(ae, simple_thread));
- scoped_terminate<BOOST_TYPEOF(act)> j(act);
-
-* a RAII scoped_fork_join which will fork on construction and join the assocaited act on the destructor if not already joined,
-
- basic_threader ae;
- scoped_fork_join<BOOST_TYPEOF(bith::fork(ae, simple_thread)) > act(ae, simple_thread);
-
-* a RAII scoped_fork_terminate which will fork on construction and call to teminate on the destructor if not already joined,
-
- basic_threader ae;
- scoped_fork_terminate<BOOST_TYPEOF(bith::fork(ae, simple_thread) > act(ae, simple_thread);
-
-In addition unique_joiner/shared_joiner have a on_destruction parameter allowing to parameterize this behavior.
-
-
-[/*Tests:
-
-Add tests for move only __ACT__ basic_threader, unique_threader and unique_launcher)
-Change the implementation of the queue on the async_ostream.
-]
-[*Examples:]
-
-* Parallel sort
-
-[/*Documentation:
-
-* Complete ae/act framework.
-]
-[/*Fixed Bugs:]
-
-*]
-
-[endsect]
-
-[section [*Version 0.4.0, February 8, 2009] Improvements + bug fixes]
 
-[*New Features:]
-
-* New free functions for all the __ACT__ operations, providing a higher degree of freedom.
-* Missing `have_all_values()`, `have_all_exception()` and `are_all_ready()` functions on __ACT__ fusion tuples.
-* `get_all`: getting all the values from a tuple of __ACT__ works now.
-* fork_after overloaded for a single dependency
-* wait_all overloaded for a single ACT.
-* wait_for_all evaluate one of its elements on the current thread
-* No need to use `wait_and_get()` on `thread_specific_shared_ptr<>` to synchronize with the decoration
-if the thread is created using a __AE__ decorator. In this case the synchro is done before returning the __ACT__.
-See the tutorial and the mono_thread_id example.
-
-[*Documentation:]
-
-* New Tickets and test appendices
+[section [*Version 0.1.2, February 8, 2009] Bug fixes]
 
 [*Fixed Bugs:]
 
-[*v0.2#1: `ae::get_all` do not work yet.]
-`get_all()` do not work because fusion transform sequence function can not take non const sequences.
-I have emulated it using `set_all()` and a transformation for a tuple of __ACT__ to a tuple of result_type.
-
 [*v0.3.1#1: keep alive mechanism crash when setting `set_on_dead_thread()` before enabling the mechanism.]
 This was due to the fact that there were no default data for the backup.
 
@@ -106,54 +31,8 @@
 
 [endsect]
 
-[section [*Version 0.3.1, January 25, 2009] bug fixes]
-
-[*Fixed Bugs:]
 
-[*v0.3#3: `scheduler::do_test_fork_after_wait` do not work yet.]
-To solve this issue it enough to define boost::move for tp::task
-
-[*v0.3#2: `scheduler::do_test_fork_after_get` do not work yet.]
-To solve this issue it enough to define boost::move for tp::task
-
-[*v0.3#1: `scheduler::do_test_wait_for_any` do not work yet.]
-Not reproductible
-
-[*v0.2#2: Some trouble with the use of `tp::pool` directly, use `scheduler` instead.]
-Four issues.
-
-* The parameter to fork on `tp:pool` was a `const F&` instead of a `F`.
-* Direct use of `fork_all` resolved for the other __AE__ by ADL, which could not be the case for the `tp::pool`.
-* `fork` specialization for `tp::pool` incorrect.
-* use of the default handle instead of `asynchronous_completion_token` traits class
-
-[endsect]
-
-[section [*Version 0.3.0, January 19, 2009] fork after dependant act completes]
-
-[*New Features:]
-
-* `fork_after`: request the __AE__ to execute a function asynchronously once each one of __ACT__ s in the dependency tuple parameter are ready.
-* Add act traits, as value type, is movable, has_future_if, has_thread_if
-
-[endsect]
-
-[section [*Version 0.2.0, January 14, 2009] Asynchronous execution and test on more toolsets]
-
-[*New Features:]
-
-* Asynchronous executors (AE) and asynchronous completion token (ACT) framework
- * `fork` and `fork_all` functions
- * `wait_for_all`, `wait_for_any` functions
- * `set_all`, `join_all`, ...
-* `unique/shared_threader` (AE) and `unique/shared_joiner` (ACT) classes
-* `basic_threader` (AE) class
-* `unique/shared_launcher` (AE) class
-* `scheduler` (AE) class (working with `tp::pool`(AE) and `tp::task<>` (ACT))
-* `thread_decorator` can now decorate a nullary function in addition to a callable function
-* `asynchronous_executor_decorator` mixin allows to decorate the functions launched by an asynchronous executor
-* Boost.Typeof registration for the __ACT__ classes
-* The AE/ACT framework comes with significant tests
+[section [*Version 0.1.1, January 14, 2009] Bug fixes and test on more toolsets]
 
 [*Toolsets:]
 
@@ -182,40 +61,18 @@
 
 [heading [*Open Bugs:]]
 
-[*v0.4.0#1: wait_for_any.]
 
 [heading [*Fixed Bugs:]]
 
-[*v0.3.1#1: keep alive mechanism crash when setting set_on_dead_thread before enabling the mechanism.]
+[*v0.1.1#1: keep alive mechanism crash when setting set_on_dead_thread before enabling the mechanism.]
 This was due to the fact that there were no default data for the backup.
 
-[*v0.3.1#2: keep alive mechanism do not detect dead threads.]
+[*v0.1.1#2: keep alive mechanism do not detect dead threads.]
 We need to reste the counters only when the period is 0.
 
-[*v0.3.1#3: The set_on_dead_thread setting is not recovered by embeeding enablers/disablers.]
+[*v0.1.1#3: The set_on_dead_thread setting is not recovered by embeeding enablers/disablers.]
 The problem is that the on_dead and th thread pointer were stored on the backup. It is enough to store them on the
 
-[*v0.2#1: ae::get_all do not work yet.]
-get_all do not work because fusion transform sequence function can not take non const sequences.
-I have emulated it using set_all and a transformation for a tuple of ACT to a tuple of result_type.
-
-[*v0.3#3: scheduler::do_test_fork_after_wait do not work yet.]
-To solve this issue it enough to define boost::move for tp::task
-
-[*v0.3#2: scheduler::do_test_fork_after_get do not work yet.]
-To solve this issue it enough to define boost::move for tp::task
-
-[*v0.3#1: scheduler::do_test_wait_for_any do not work yet.]
-Not reproductible
-
-[*v0.2#2: Some trouble with the use of tp::pool directly, use scheduler instead.]
-Four issues.
-
-* The parameter to fork on tp:pool was a const F& instead of a F.
-* Direct use of fork_all resolved for the other AE by ADL, which could not be the case fro the tp::pool.
-* fork specialization for tp::pool incorrent.
-* use of the default handle instead of asynchronous_completion_token traits class
-
 [*v0.1#1: basic_keep_alive example do not link.]
 
 [endsect]

Modified: sandbox/interthreads/libs/interthreads/doc/concepts.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/concepts.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/concepts.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -16,462 +16,5 @@
 [/=============================================]
 [endsect]
 
-[/=============================================]
-[section Asynchronous Completion Token Concepts]
-[/=============================================]
-
-[/==================]
-[section:ACT Concept `ACT` ]
-[/==================]
-
-[heading Description]
-An __ACT__ allows to wait for the completion of an asynchronous executed operation.
-An __ACT__ should be __Movable__ or __CopyConstructible__.
-The completion of the __ACT__ is undefined at this level. Different models could signal this completion when setting a value or an exception.
-
-[heading Notation]
-
-[variablelist
- [[`act`] [An __ACT__]]
- [[`f`] [A __Nullary__ function with type F]]
- [[`abs_time`] [A __system_time__]]
- [[`rel_time`] [A __Duration__]]
- [[`b`] [A bool]]
-]
-
-[heading Expression requirements]
-A type models a __ACT__ if, the following expressions are valid:
-
-[table
- [[Expression] [Return type] [Runtime Complexity]]
- [[`wait(act)`] [void] [Constant]]
- [[`b = wait_until(act, abs_time)`] [bool] [Constant]]
- [[`b = wait_for(act, rel_time)`] [bool] [Constant]]
-]
-
-[heading Meta Expressions]
-[table
- [[Expression] [Type] [Compile Time Complexity]]
- [[`act_traits<ACT>::move_dest_type`] [Any] [Constant]]
- [[`act_traits<ACT>::move_result`] [MPL boolean] [Constant]]
- [[`is_movable<ACT>::type`] [MPL boolean] [Constant]]
- [[`has_future_if<ACT>::type`] [MPL boolean] [Constant]]
- [[`has_thread_if<ACT>::type`] [MPL boolean] [Constant]]
-]
-
-
-
-[heading Expression Semantics]
-[
-table
- [[Expression] [Semantics]]
- [[`wait(act)`] [Blocks until the `act` completes]]
- [[`b = wait_until(act,abs_time)`] [Blocks until the `act` completes or `abs_time` is reached]]
- [[`b = wait_for(act,rel_time)`] [Blocks until the `act` completes or `rel_time` has been elapsed]]
-]
-
-
-[heading Expression `wait(act)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Effects:] [Blocks until the `act` completes.]]
-[[Sychronization:][The completion of `act` happens before wait() returns.]]
-[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
-[[Postconditions:] [is_ready(act) == true.]]
-[[Thread safety:][unsafe]]
-]
-
-[heading Expression `b = wait_until(act,abs_time)`]
-[/==========================================================================================]
-
- bool wait_until(const system_time& abs_time);
- template<typename TimeDuration>
- bool wait_for(TimeDuration const& rel_time);
-
-
-[variablelist
-[[Effects:] [Blocks until the `act` completes or `abs_time` is not reached.]]
-[[Sychronization:][The completion of the `act` happens before wait() returns.]]
-[[Returns:] [true only if the function returns because `act` is ready.]]
-[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
-[[Postconditions:] [is_ready() == true.]]
-[[Thread safety:][unsafe]]
-]
-
-[heading Expression `b = wait_for(act,rel_time)`]
-[/==========================================================================================]
-
-
-
-[variablelist
-[[Effects:] [blocks until the `act` completes or `rel_time` has elapsed.]]
-[[Sychronization:][The completion of the `act` happens before wait() returns.]]
-[[Returns:] [true only if the function returns because `act` is ready.]]
-[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
-[[Postconditions:] [is_ready() == true.]]
-[[Thread safety:][unsafe]]
-]
-
-[heading Models]
-
-* __unique_future__
-* __shared_future__
-* __unique_joiner__
-* __shared_joiner__
-* __tp_task__
-* __thread__
-
-[endsect]
-
-[/=============================]
-[section:FutureBasedACT Concept `FutureBasedACT` ]
-[/=============================]
-The completion of the __FutureBasedACT__ is undefined at this level but occurs usualy after a set_calue or set_exception on the associated promise.
-
-
-[heading Description]
-
-An __FutureBasedACT__ is a __ACT__ that associates a value expected on the its completion.
-
-[heading Notation]
-
-[variablelist
- [[`act`] [An __ACT__]]
- [[`cact`] [An const __ACT__]]
- [[`f`] [A __Nullary__ function with type F]]
- [[`abs_time`] [A __system_time__]]
- [[`rel_time`] [A __Duration__]]
- [[`b`] [A bool]]
- [[`v`] [`act_traits<typeof(act)>::move_dest_type`]]
-]
-
-[heading Expression requirements]
-
-A type models an __FutureBasedACT__ if, in adition to being an __ACT__,
-the following expressions are valid:
-
-[table
- [[Expression] [Return type] [Runtime Complexity]]
- [[`v = get(act)`] [`act_traits<typeof(act)>::move_dest_type`] [Constant]]
- [[`b = is_ready(cact)`] [bool] [Constant]]
- [[`b = has_exception(cact)`] [bool] [Constant]]
- [[`b = has_value(cact)`] [bool] [Constant]]
-]
-
-[heading Expression Semantics]
-[table
- [[Expression] [Semantics]]
- [[`v = get(act)`] [Blocks until `act` contains a value and returns the stored value]]
- [[`b = is_ready(cact)`] [Is true only if `cact` holds a value or an exception ready for retrieval.]]
- [[`b = has_exception(cact)`] [Is true only if `cact` contains an exception.]]
- [[`b = has_value(cact)`] [Is true only if `cact` contains a value]]
-]
-
-[heading Expression `v=get(act)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Effects:] [Retrieves the value returned by the Nullary function.]]
-[[Sychronization:][The completion of the `act` happens before get() returns.]]
-[[Returns:] [Depending on the nature of the ACT returns a `act_traits<ACT>::move_dest_type`.]]
-[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
-[[Postconditions:] [if `act_traits<ACT>::move_result` is `true` it is unspecified what happens when `get()` is called a second time on the same shared_joiner.]]
-[[Thread safety:][unsafe]]
-]
-
-[heading Expression `b = is_ready(cact)`]
-[/==========================================================================================]
-
-[variablelist
-[[Returns:] [true only if `cact` holds a value or an exception ready for retrieval.]]
-[[Remark:] [if `act_traits<ACT>::move_result` is true the return value could be unspecified after a call to `get(act)`.]]
-]
-
-[heading Expression `b = has_exception(cact)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Returns:] [true only if `is_ready(cact)` == true and `cact` contains an exception.]]
-]
-
-[heading Expression `b = has_value(cact)`]
-[/==========================================================================================]
-
-[variablelist
-[[Returns:] [true only if `is_ready(cact)` == true and `cact` contains a value.]]
-]
-
-[heading Models]
-
-* __unique_future__
-* __shared_future__
-* __unique_joiner__
-* __shared_joiner__
-* __tp_task__
-
-[endsect]
-
-[/=============================]
-[section:ThreadBasedACT Concept `ThreadBasedACT` ]
-[/=============================]
-
-The completion of the __ThreadBasedACT__ is undefined at this level but occurs usualy after a function finish.
-
-[heading Description]
-
-An __ThreadBasedACT__ is a __ACT__ that provides a thread like interface.
-
-[heading Notation]
-
-[variablelist
- [[`act`] [An __ACT__]]
- [[`cact`] [A const __ACT__]]
- [[`cact`] [An const __ACT__]]
- [[`f`] [A __Nullary__ function with type F]]
- [[`abs_time`] [A __system_time__]]
- [[`rel_time`] [A __Duration__]]
- [[`b`] [A bool]]
- [[`id`] [An `act_traits<__ACT__>::id_type`]]
-]
-
-[heading Expression requirements]
-A type models an __FutureBasedACT__ if, in adition to being an __ACT__,
-the following expressions are valid:
-
-[table
- [[Expression] [Return type] [Runtime Complexity]]
- [[`b = joinable(cact)`] [bool] [Constant]]
- [[`join(act)`] [void] [Constant]]
- [[`b = join_until(act, abs_time)`] [bool] [Constant]]
- [[`b = join_for(act, rel_time)`] [bool] [Constant]]
- [[`detach(act)`] [void] [Constant]]
- [[`interrupt(act)`] [void] [Constant]]
- [[`b = interruption_requested(cact)`] [bool] [Constant]]
- [[`id = get_id(cact)`] [`act_traits<__ACT__>::id_type`] [Constant]]
-]
-
-[heading Expression Semantics]
-[table
- [[Expression] [Semantics]]
- [[`b = joinable(cact)`] [true if `cact` refers to a 'thread of execution', false otherwise]]
- [[`join(act)`] [waits for the assoiated 'thread of execution' to complete]]
- [[`b = join_until(act, abs_time)`] [waits for the assoiated 'thread of execution' to complete or the time `wait_until` has been reach.]]
- [[`b = join_for(act, rel_time)`] [waits for the assoiated 'thread of execution' to complete or the specified duration `rel_time` has elapsed ]]
- [[`detach(act)`] [the associated 'thread of execution' becomes detached, and no longer has an associated one]]
- [[`interrupt(act)`] [request that the associated 'thread of execution' be interrupted the next time it enters
- one of the predefined interruption points with interruption enabled, or if it is currently blocked in a call to one of the
- predefined interruption points with interruption enabled]]
- [[`b = interruption_requested(cact)`] [true if interruption has been requested for the associated 'thread of execution', false otherwise. ]]
- [[`id = get_id(cact)`] [an instance of `act_traits<__ACT__>::id_type` that represents the associated 'thread of execution'.]]
-]
-
-[heading Expresion `b=joinable(act)`]
-[/==========================================================================================]
-
-[variablelist
-[[Returns:] [true if `act` refers to a 'thread of execution', false otherwise]]
-[[Throws:] [Nothing]]
-]
-
-
-[heading Expresion `join()`]
-[/==========================================================================================]
-
-[variablelist
-[[Preconditions:] [`get_id(act)!=boost::interthreads::get_current_id<ACT>()`]]
-[[Effects:] [If `act` refers to a thread of execution, waits for that 'thread of execution' to complete.]]
-[[Postconditions:] [If `act` refers to a 'thread of execution' on entry, that 'thread of execution' has completed.
-`act` no longer refers to any 'thread of execution'.]]
-[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
-[[Notes:] [`join()` is one of the predefined __interruption_points__.]]
-]
-
-[heading Expresion `b=join_until(act)|b=join_for(act)`]
-[/==========================================================================================]
-
- bool join_until(const system_time& wait_until);
-
- template<typename TimeDuration>
- bool join_for(TimeDuration const& rel_time);
-
-[variablelist
-[[Preconditions:] [`get_id(act)!=boost::interthreads::get_current_id<ACT>()`]]
-[[Effects:] [If `act` refers to a 'thread of execution', waits for that thread of execution to complete, the time `wait_until` has
-been reach or the specified duration `rel_time` has elapsed. If `act` doesn't refer to a 'thread of execution', returns immediately.]]
-[[Returns:] [`true` if `act` refers to a thread of execution on entry, and that thread of execution has completed before the call
-times out, `false` otherwise.]]
-[[Postconditions:] [If `act` refers to a thread of execution on entry, and `timed_join` returns `true`, that thread of execution
-has completed, and `act` no longer refers to any thread of execution. If this call to `timed_join` returns `false`, `*this` is
-unchanged.]]
-[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
-[[Notes:] [`join_until()` is one of the predefined __interruption_points__.]]
-]
-
-[heading Expresion `detach(act)`]
-[/==========================================================================================]
-
-[variablelist
-[[Effects:] [If `act` refers to a 'thread of execution', that 'thread of execution' becomes detached, and no longer has an associated thread object.]]
-[[Postconditions:] [`act` no longer refers to any 'thread of execution'.]]
-[[Throws:] [Nothing]]
-]
-
-[heading Expresion `get_id(cact)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Returns:] [If `act` refers to a 'thread of execution', an instance of `act_traits<__ACT__>::id_type` that represents that __ACT__.
-Otherwise returns a default-constructed `act_traits<__ACT__>::id_type`.]]
-[[Throws:] [Nothing]]
-]
-
-[heading Expresion `interrupt(act)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Effects:] [If `act` refers to a 'thread of execution', request that the 'thread of execution' will be interrupted the next time it enters one of
-the predefined __interruption_points__ with interruption enabled, or if it is currently __blocked__ in a call to one of the
-predefined __interruption_points__ with interruption enabled .]]
-[[Throws:] [Nothing]]
-]
-
-[heading Expresion `h = native_handle(act)`]
-[/==========================================================================================]
-
-
-[variablelist
-[[Effects:] [Returns an instance of `native_handle_type` that can be used with platform-specific APIs to manipulate the underlying
-implementation. If no such instance exists, `native_handle()` and `native_handle_type` are not present.]]
-[[Throws:] [Nothing.]]
-]
-
-
-
-[heading Models]
-
-* __unique_joiner__
-* __shared_joiner__
-* __thread__
-* __tp_task__
-
-[endsect]
-
-[endsect]
-
-[/======================================]
-[section Asynchronous Executors Concepts]
-[/======================================]
-
-[/==========================================================================================]
-[section Concept `AsynchronousExecutor`]
-[/==========================================================================================]
-
-[heading Description]
-
-An __AsynchronousExecutor__ executes asynchronously a function and returns an __ACT__ when calling the fork function on it.
-
-[heading Notation]
-
-[variablelist
- [[`ae`] [An __AE__]]
- [[`f`] [A __Nullary__ function with type F]]
- [[`act`] [An __ACT__]]
-]
-
-[heading Expression requirements]
-A type models a __AE__ if, the following expressions are valid:
-
-[table
- [[Expression] [Return type] [Runtime Complexity]]
- [[`__fork__(ae, f)`] [__ACT__] [Constant]]
- [[`get_future<AE>()(act)`] [__Future__] [Constant]]
- [[`asynchronous_completion_token<AE, T>::type`] [Model of __ACT__ satisfying `__act_value<ACT>::type` is `T`] [Constant]]
-]
-
-[heading Expression Semantics]
-[
-table
- [[Expression] [Semantics]]
- [[`act = __fork__(ae, f)`] [request `ae` to execute asynchronously the function `f`and returns an __ACT__ ]]
- [[`get_future<AE>()(act)`] [gets a reference to a __Future__]]
-]
-
-[heading Constraints]
-The following constraints applies:
-
-* `act_value<__ACT__>::type == boost::result_of<F()::type>`
-
-[heading Models]
-
-* __basic_threader__
-* __unique_threader__
-* __shared_threader__
-* __launcher__
-* __shared_launcher__
-* __scheduler__
-* __tp_pool__
-
-
-[endsect]
-
-
-[/==========================================================================================]
-[section Concept `IntrinsicAsynchronousExecutor`]
-[/==========================================================================================]
-
-[heading Description]
-
-The default fork implementation put some requirements in its __AE__ parameter. This concept is related to this.
-An __IAE__ is __AE__ that works well with the default implementation of __fork__.
-
-[heading Notation]
-
-[variablelist
- [[`ae`] [An __IAE__]]
- [[`f`] [A __Nullary__ function]]
-]
-
-[heading Expression requirements]
-A type models an __IAE__ if, in adition to being an __AE__,
-the following expressions are valid:
-
-[table
- [[Expression] [Return type] [Runtime Complexity]]
- [[`ae.fork(f)`] [`handle<boost::result_of<F()>::type`] [Constant]]
-]
-
-[heading Meta Expressions]
-[table
- [[Expression] [Model Of] [Compile Time Complexity]]
- [[`handle<boost::result_of<F()>::type`] [__ACT__] [Constant ]]
-]
-
-[heading Expression Semantics]
-[
-table
- [[Expression] [Semantics]]
- [[`ae.fork(f)`] [executes asynchronously the function `f` and returns a __handle__ ]]
-]
-
-
-[heading Models]
-* __basic_threader__
-* __unique_threader__
-* __shared_threader__
-* __launcher__
-* __shared_launcher__
-* __scheduler__
-
-
-
-[endsect]
-
-[endsect]
 
 [endsect]

Modified: sandbox/interthreads/libs/interthreads/doc/getting_started.qbk
==============================================================================
--- sandbox/interthreads/libs/interthreads/doc/getting_started.qbk (original)
+++ sandbox/interthreads/libs/interthreads/doc/getting_started.qbk 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -55,14 +55,6 @@
 Bye, Bye!
 ]
 
-[/
-
- int main() {
- bith::wait_for_all(basic_threader_decorator, my_thread);
- return 0;
- }
-
-]
 
 [endsect]
 
@@ -193,52 +185,6 @@
 
 [endsect]
 
-[/==========================]
-[section Multiple algorithms]
-[/==========================]
-
-This example shows how to launch several algorithms and wait only for the more efficient.
-
- #include <boost/interthreads/typeof/threader.hpp>
- #include <boost/interthreads/wait_for_any.hpp>
- #include <iostream>
-
- namespace bith = boost::interthreads;
-
- int my_thread1() {
- sleep(3);
- std::cout << "1 thread_id=" << boost::this_thread::get_id() << std::endl;
- }
-
- int my_thread2() {
- sleep(1);
- std::cout << "2 thread_id=" << boost::this_thread::get_id() << std::endl;
- }
-
- int my_thread3() {
- sleep(2);
- std::cout << "3 thread_id=" << boost::this_thread::get_id() << std::endl;
- }
-
- int main() {
- bith::shared_threader ae;
- BOOST_AUTO(res,bith::wait_for_any(ae, my_thread1, my_thread2, my_thread3));
- std::cout << "Algotithm " << result.first+1 << " finished the first. result=" << result.second << std::endl;
- return 0;
- }
-
-This results on the following output
-
-[pre
-3 thread_id=0x9c03f8
-2 thread_id=0x9c0850
-1 thread_id=0x9d0c40
-Algotithm 2 finished the first. result=0
-
-]
-
-
-[endsect]
 
 [endsect]
 

Added: sandbox/interthreads/libs/interthreads/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/index.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,106 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Toward Boost.InterThreads</title>
+<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Toward Boost.InterThreads">
+<link rel="next" href="toward_boost_interthreads/overview.html" title=" Overview">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="toward_boost_interthreads/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="article" lang="en">
+<div class="titlepage">
+<div>
+<div><h2 class="title">
+<a name="toward_boost_interthreads"></a>Toward Boost.InterThreads</h2></div>
+<div><div class="authorgroup"><div class="author"><h3 class="author">
+<span class="firstname">Vicente J.</span> <span class="surname">Botet Escriba</span>
+</h3></div></div></div>
+<div><p class="copyright">Copyright © 2008 -2009 Vicente J. Botet Escriba</p></div>
+<div><div class="legalnotice">
+<a name="id4803231"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"> Overview</span></dt>
+<dd><dl><dt><span class="section"> Motivation</span></dt></dl></dd>
+<dt><span class="section"> Users'Guide</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="toward_boost_interthreads/users_guide/getting_started.html">
+ Getting Started</a></span></dt>
+<dt><span class="section"> Tutorial</span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/users_guide/bibliography.html">
+ References</a></span></dt>
+<dt><span class="section"> Glossary</span></dt>
+</dl></dd>
+<dt><span class="section"> Reference</span></dt>
+<dd><dl>
+<dt><span class="section">Concepts</span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/reference/thread_extensions_reference.html">Thread
+ Extensions Reference</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/reference/thread_array_reference.html">Thread
+ Array Reference</a></span></dt>
+</dl></dd>
+<dt><span class="section">Examples</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="toward_boost_interthreads/examples/thread_safe_deferred_traces.html">Thread
+ safe deferred traces</a></span></dt>
+<dt><span class="section"> STM</span></dt>
+</dl></dd>
+<dt><span class="section">Appendices</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/changes.html"> Appendix
+ A: History</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/rationale.html"> Appendix
+ B: Rationale</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/implementation.html">
+ Appendix C: Implementation Notes</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/acknowledgements.html">
+ Appendix D: Acknowledgments</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/tests.html"> Appendix
+ E: Tests</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/tickets.html"> Appendix
+ F: Tickets</a></span></dt>
+<dt><span class="section"><a href="toward_boost_interthreads/appendices/todo.html"> Appendix
+ G: Future plans</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/html/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Toward Boost.InterThreads is not a part of the Boost libraries.
+ </p></td></tr>
+</table></div>
+<p>
+ [/
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: October 05, 2009 at 16:58:26 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="toward_boost_interthreads/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/standalone_HTML.manifest
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/standalone_HTML.manifest 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,23 @@
+index.html
+toward_boost_interthreads/overview.html
+toward_boost_interthreads/overview/motivation.html
+toward_boost_interthreads/users_guide.html
+toward_boost_interthreads/users_guide/getting_started.html
+toward_boost_interthreads/users_guide/tutorial.html
+toward_boost_interthreads/users_guide/bibliography.html
+toward_boost_interthreads/users_guide/glosary.html
+toward_boost_interthreads/reference.html
+toward_boost_interthreads/reference/concepts.html
+toward_boost_interthreads/reference/thread_extensions_reference.html
+toward_boost_interthreads/reference/thread_array_reference.html
+toward_boost_interthreads/examples.html
+toward_boost_interthreads/examples/thread_safe_deferred_traces.html
+toward_boost_interthreads/examples/stm.html
+toward_boost_interthreads/appendices.html
+toward_boost_interthreads/appendices/changes.html
+toward_boost_interthreads/appendices/rationale.html
+toward_boost_interthreads/appendices/implementation.html
+toward_boost_interthreads/appendices/acknowledgements.html
+toward_boost_interthreads/appendices/tests.html
+toward_boost_interthreads/appendices/tickets.html
+toward_boost_interthreads/appendices/todo.html

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,97 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Appendices</title>
+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="prev" href="examples/stm.html" title=" STM">
+<link rel="next" href="appendices/changes.html" title=" Appendix
+ A: History">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="examples/stm.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="appendices/changes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="toward_boost_interthreads.appendices"></a>Appendices
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="appendices/changes.html"> Appendix
+ A: History</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="appendices/changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_3__mars_29__2009__extraction_of_the_asynchonous_executor_framework"><span class="bold"><strong>Version 0.1.3, Mars 29, 2009</strong></span> Extraction of the Asynchonous
+ Executor framework</a></span></dt>
+<dt><span class="section">Version 0.1.2, February 8, 2009 Bug fixes</span></dt>
+<dt><span class="section"><a href="appendices/changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_1__january_14__2009__bug_fixes_and_test_on_more_toolsets"><span class="bold"><strong>Version 0.1.1, January 14, 2009</strong></span> Bug fixes and test
+ on more toolsets</a></span></dt>
+<dt><span class="section"><a href="appendices/changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_0__november_30__2008____announcement_of_interthreads_"><span class="bold"><strong>Version 0.1.0, November 30, 2008</strong></span> <span class="emphasis"><em>Announcement
+ of Interthreads</em></span></a></span></dt>
+<dt><span class="section">Bugs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="appendices/rationale.html"> Appendix
+ B: Rationale</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="appendices/rationale.html#toward_boost_interthreads.appendices.rationale.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="appendices/rationale.html#toward_boost_interthreads.appendices.rationale.thread_specific_storage">Thread
+ Specific Storage</a></span></dt>
+<dt><span class="section"><a href="appendices/rationale.html#toward_boost_interthreads.appendices.rationale.keep_alive">Keep
+ Alive</a></span></dt>
+<dt><span class="section"><a href="appendices/rationale.html#toward_boost_interthreads.appendices.rationale.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="appendices/implementation.html">
+ Appendix C: Implementation Notes</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="appendices/implementation.html#toward_boost_interthreads.appendices.implementation.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="appendices/implementation.html#toward_boost_interthreads.appendices.implementation.thread_specific_storage">Thread
+ Specific Storage</a></span></dt>
+<dt><span class="section"><a href="appendices/implementation.html#toward_boost_interthreads.appendices.implementation.keep_alive">Keep
+ Alive</a></span></dt>
+<dt><span class="section"><a href="appendices/implementation.html#toward_boost_interthreads.appendices.implementation.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="appendices/acknowledgements.html">
+ Appendix D: Acknowledgments</a></span></dt>
+<dt><span class="section"><a href="appendices/tests.html"> Appendix
+ E: Tests</a></span></dt>
+<dd><dl><dt><span class="section">thread_specific_shared_pointer</span></dt></dl></dd>
+<dt><span class="section"><a href="appendices/tickets.html"> Appendix
+ F: Tickets</a></span></dt>
+<dt><span class="section"><a href="appendices/todo.html"> Appendix
+ G: Future plans</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="appendices/todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review">Tasks
+ to do before review</a></span></dt>
+<dt><span class="section"><a href="appendices/todo.html#toward_boost_interthreads.appendices.todo.for_later_releases">For
+ later releases</a></span></dt>
+</dl></dd>
+</dl></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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="examples/stm.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="appendices/changes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/acknowledgements.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/acknowledgements.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>
+ Appendix D: Acknowledgments</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="implementation.html" title="
+ Appendix C: Implementation Notes">
+<link rel="next" href="tests.html" title=" Appendix
+ E: Tests">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="implementation.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="tests.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.acknowledgements"></a><a href="acknowledgements.html" title="
+ Appendix D: Acknowledgments">
+ Appendix D: Acknowledgments</a>
+</h3></div></div></div>
+<p>
+ Part of this library (thread_decorator and thread_specific_shared_ptr) are
+ based on the original implementation of threadalert written by Roland Schwarz (thread::init
+ and thread_member_ptr). Many Thanks to Roland that allowed me to adapt his
+ implementation.
+ </p>
+<p>
+ Thanks also must go to Jochen Heckl for the ideas given respect to the thread_tuple::wait_first
+ implementation.
+ </p>
+<p>
+ You can help me to make this library better! Any feedback is very welcome.
+ </p>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="implementation.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="tests.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/changes.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/changes.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,180 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Appendix
+ A: History</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="../appendices.html" title="Appendices">
+<link rel="next" href="rationale.html" title=" Appendix
+ B: Rationale">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../appendices.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="rationale.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.changes"></a><a href="changes.html" title=" Appendix
+ A: History"> Appendix
+ A: History</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_3__mars_29__2009__extraction_of_the_asynchonous_executor_framework"><span class="bold"><strong>Version 0.1.3, Mars 29, 2009</strong></span> Extraction of the Asynchonous
+ Executor framework</a></span></dt>
+<dt><span class="section">Version 0.1.2, February 8, 2009 Bug fixes</span></dt>
+<dt><span class="section"><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_1__january_14__2009__bug_fixes_and_test_on_more_toolsets"><span class="bold"><strong>Version 0.1.1, January 14, 2009</strong></span> Bug fixes and test
+ on more toolsets</a></span></dt>
+<dt><span class="section"><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_0__november_30__2008____announcement_of_interthreads_"><span class="bold"><strong>Version 0.1.0, November 30, 2008</strong></span> <span class="emphasis"><em>Announcement
+ of Interthreads</em></span></a></span></dt>
+<dt><span class="section">Bugs</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.changes.__version_0_1_3__mars_29__2009__extraction_of_the_asynchonous_executor_framework"></a><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_3__mars_29__2009__extraction_of_the_asynchonous_executor_framework" title="Version 0.1.3, Mars 29, 2009 Extraction of the Asynchonous
+ Executor framework"><span class="bold"><strong>Version 0.1.3, Mars 29, 2009</strong></span> Extraction of the Asynchonous
+ Executor framework</a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Extraction of the Asynchonous Executor framework
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.changes.__version_0_1_2__february_8__2009__bug_fixes"></a>Version 0.1.2, February 8, 2009 Bug fixes
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Fixed Bugs:</strong></span>
+ </p>
+<p>
+ <span class="bold"><strong>v0.3.1#1: keep alive mechanism crash when setting
+ <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code>
+ before enabling the mechanism.</strong></span> This was due to the fact that
+ there were no default data for the backup.
+ </p>
+<p>
+ <span class="bold"><strong>v0.3.1#2: keep alive mechanism do not detect dead
+ threads.</strong></span> We need to reset the counters only when the period
+ is 0.
+ </p>
+<p>
+ <span class="bold"><strong>v0.3.1#3: The <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code> setting is not recovered by embeeding
+ kep_alive enablers/disablers.</strong></span> The problem is that the <code class="computeroutput"><span class="identifier">on_dead</span><span class="special">()</span></code>
+ the function and the thread pointer were stored on the backup. It is enough
+ to store them on the <code class="computeroutput"><span class="identifier">thread_keep_alive_ctx</span></code>
+ and make the functions thread_safe.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.changes.__version_0_1_1__january_14__2009__bug_fixes_and_test_on_more_toolsets"></a><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_1__january_14__2009__bug_fixes_and_test_on_more_toolsets" title="Version 0.1.1, January 14, 2009 Bug fixes and test
+ on more toolsets"><span class="bold"><strong>Version 0.1.1, January 14, 2009</strong></span> Bug fixes and test
+ on more toolsets</a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Toolsets:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Tested on Linux gcc 3.4.6.
+ </li>
+<li>
+ Tested on Linux gcc 4.1.2.
+ </li>
+<li>
+ Modification helping Windows (not tested)
+ </li>
+</ul></div>
+<p>
+ <span class="bold"><strong>Fixed Bugs:</strong></span>
+ </p>
+<p>
+ <span class="bold"><strong>v0.1#1: basic_keep_alive example do not link.</strong></span>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.changes.__version_0_1_0__november_30__2008____announcement_of_interthreads_"></a><a href="changes.html#toward_boost_interthreads.appendices.changes.__version_0_1_0__november_30__2008____announcement_of_interthreads_" title="Version 0.1.0, November 30, 2008 Announcement
+ of Interthreads"><span class="bold"><strong>Version 0.1.0, November 30, 2008</strong></span> <span class="emphasis"><em>Announcement
+ of Interthreads</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">thread_decorator</span></code> setup/cleanup
+ thread decorator,
+ </li>
+<li>
+ thread specific shared pointer,
+ </li>
+<li>
+ thread keep alive mechanism,
+ </li>
+<li>
+ thread tuples, set_once synchonizer, thread_tuple_once and thread_group_once.
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.changes.__bugs_"></a>Bugs
+</h4></div></div></div>
+<a name="toward_boost_interthreads.appendices.changes.__bugs_._emphasis_role__bold__open_bugs___emphasis_"></a><h5>
+<a name="id4854878"></a>
+ Open Bugs:
+ </h5>
+<a name="toward_boost_interthreads.appendices.changes.__bugs_._emphasis_role__bold__fixed_bugs___emphasis_"></a><h5>
+<a name="id4854907"></a>
+ Fixed Bugs:
+ </h5>
+<p>
+ <span class="bold"><strong>v0.1.1#1: keep alive mechanism crash when setting
+ set_on_dead_thread before enabling the mechanism.</strong></span> This was due
+ to the fact that there were no default data for the backup.
+ </p>
+<p>
+ <span class="bold"><strong>v0.1.1#2: keep alive mechanism do not detect dead
+ threads.</strong></span> We need to reste the counters only when the period
+ is 0.
+ </p>
+<p>
+ <span class="bold"><strong>v0.1.1#3: The set_on_dead_thread setting is not recovered
+ by embeeding enablers/disablers.</strong></span> The problem is that the on_dead
+ and th thread pointer were stored on the backup. It is enough to store
+ them on the
+ </p>
+<p>
+ <span class="bold"><strong>v0.1#1: basic_keep_alive example do not link.</strong></span>
+ </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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../appendices.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="rationale.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/implementation.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/implementation.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,196 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>
+ Appendix C: Implementation Notes</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="rationale.html" title=" Appendix
+ B: Rationale">
+<link rel="next" href="acknowledgements.html" title="
+ Appendix D: Acknowledgments">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="rationale.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="acknowledgements.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.implementation"></a><a href="implementation.html" title="
+ Appendix C: Implementation Notes">
+ Appendix C: Implementation Notes</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_specific_storage">Thread
+ Specific Storage</a></span></dt>
+<dt><span class="section"><a href="implementation.html#toward_boost_interthreads.appendices.implementation.keep_alive">Keep
+ Alive</a></span></dt>
+<dt><span class="section"><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.implementation.thread_decorator"></a><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_decorator" title="Thread
+ Decorator">Thread
+ Decorator</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Thread safe</span></dt>
+<dd><p>
+ The library is thread safe as far as the thread decorations are declared
+ staticaly, because these variables will be initialized sequentially.
+ </p></dd>
+<dt><span class="term">Chained thread decorations</span></dt>
+<dd><p>
+ All the thread decorations are chained between them.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.implementation.thread_specific_storage"></a><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_specific_storage" title="Thread
+ Specific Storage">Thread
+ Specific Storage</a>
+</h4></div></div></div>
+<p>
+ The Thread-Specific Storage pattern can be implemented in various ways
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">External versus internal thread storage</span></dt>
+<dd><p>
+ The thread specific data collections can be stored either externally
+ to all threads or internally to each thread. The thread_specific_shared_ptr
+ use both ensuring efficiency when the context is requested by the current
+ thread and allowing threads to access thread specific pointer of other
+ threads
+ </p></dd>
+<dt><span class="term">Fixed- vs. variable-sized thread specific
+ key mapping</span></dt>
+<dd><p>
+ This library is based on the the Boost.Thread thread_specific_ptr implementation
+ which use a variable-size map indexed by the address of the object.
+ Future releases will provide fixed and mixed keys.
+ </p></dd>
+<dt><span class="term">Fixed- vs. variable-sized mapping of
+ thread IDs to thread specific pointers</span></dt>
+<dd><p>
+ It may be impractical to have a fixed-size array with an entry for
+ every possible thread ID value. Instead, it is more space efficient
+ to have threads use a dynamic data structure to map thread IDs to thread
+ specific pointers.
+ </p></dd>
+<dt><span class="term">One mapping of thread IDs to thread
+ specific pointers or to thread specific key mapping</span></dt>
+<dd><p>
+ This library maps thread IDs to thread specific pointers to avoid contention
+ on a single map.
+ </p></dd>
+<dt><span class="term">Default versus explicit specific context
+ setting</span></dt>
+<dd><p>
+ This library provides explicit setting. In future release will provide
+ explicit/eager and implicit/lazy specific context setting. Note that
+ implicit setting will need a factory or a default constructible type.
+ </p></dd>
+<dt><span class="term">Ordered or unordered map</span></dt>
+<dd><p>
+ While the thread::id type is ordered, there is no need to use it. The
+ current implementation use an ordered map. Future version will allow
+ the user to configure this.
+ </p></dd>
+<dt><span class="term">Intrusive or not maps</span></dt>
+<dd><p>
+ As the thread specific pointer is stored on only one map the implementation
+ could use an intrusive container. This will be provided in future releases
+ </p></dd>
+<dt><span class="term">Shared versus exclusive locking</span></dt>
+<dd><p>
+ Locating the right TS pointer requires the use of mutex to prevent
+ race conditions. The library use a a shared_mutex because most of the
+ access to the map will be readings by other threads. The problem is
+ that the native conditions can not be used directly with shared mutex.
+ Some benchmarks will be needed before decidinf which implementation
+ is the best.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.implementation.keep_alive"></a><a href="implementation.html#toward_boost_interthreads.appendices.implementation.keep_alive" title="Keep
+ Alive">Keep
+ Alive</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Ensuring keep alive manager singleton
+ is initialized and the thread specific shared storage is set before use</span></dt>
+<dd><p>
+ The use of the thread decoration ensures that the decoration are called
+ before the user thread function is called. The keep_alive decoration
+ use the call_once to ensure that the keep_alive manager is correctly
+ initialized.
+ </p></dd>
+<dt><span class="term">backup/restore context</span></dt>
+<dd><p>
+ The real thread specific data is stored directly on the stack of enablers/disablers
+ avoiding heap memory. On enablers/disablers construction they store
+ a backup pointer to the nesting context. This allows a quick restore.
+ The keep alive pointer contains just a pointer to this data.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.implementation.thread_tuple"></a><a href="implementation.html#toward_boost_interthreads.appendices.implementation.thread_tuple" title="Thread
+ Tuple">Thread
+ Tuple</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Joining the first finishing thread</span></dt>
+<dd><p>
+ In order to synchronize the end of all the threads the libarry use
+ a internal class which stores the index of the first thread notifying
+ that it is finished. As the user function has no idea of this index
+ we need to wrap the user thread functions.
+ </p></dd>
+</dl>
+</div>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="rationale.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="acknowledgements.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/rationale.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/rationale.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,1136 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Appendix
+ B: Rationale</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="changes.html" title=" Appendix
+ A: History">
+<link rel="next" href="implementation.html" title="
+ Appendix C: Implementation Notes">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="changes.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="implementation.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.rationale"></a><a href="rationale.html" title=" Appendix
+ B: Rationale"> Appendix
+ B: Rationale</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_specific_storage">Thread
+ Specific Storage</a></span></dt>
+<dt><span class="section"><a href="rationale.html#toward_boost_interthreads.appendices.rationale.keep_alive">Keep
+ Alive</a></span></dt>
+<dt><span class="section"><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.rationale.thread_decorator"></a><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_decorator" title="Thread
+ Decorator">Thread
+ Decorator</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Function wrapper versus thread refinement</span></dt>
+<dd><p>
+ The threadalert on which this library was initialy based redefined
+ the boost:thread class which called implicitly the wrapper. As the
+ single varying features between both threads was this wrapping of the
+ thread function it has been isolated in the interthreads library.
+ </p></dd>
+<dt><span class="term">Static decoration variables</span></dt>
+<dd><p>
+ Thread decorations construction is not thread safe and must be done
+ before other threads have been created and the <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code> function is called.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.rationale.thread_specific_storage"></a><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_specific_storage" title="Thread
+ Specific Storage">Thread
+ Specific Storage</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Non copiable/Non movable</span></dt>
+<dd><p>
+ Specific pointers are singletons.
+ </p></dd>
+<dt><span class="term">External locking</span></dt>
+<dd><p>
+ In order to ensure thread safety while providing as much functionality
+ as possible the class allows to get the map of thread specific contexts
+ as soon as the application provides a <code class="computeroutput"><span class="identifier">unique_lock</span></code>.
+ </p></dd>
+<dt><span class="term">Mimic thread_specific_ptr</span></dt>
+<dd>
+<p>
+ From the point of view of the current thread thread_specific_shared_ptr
+ behaves as a thread_specific_ptr. From it we takes:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">thread_specific_shared_ptr</span><span class="special">();</span>
+<span class="keyword">explicit</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">(</span><span class="keyword">void</span> <span class="special">(*</span><span class="identifier">cleanup_</span><span class="special">)(</span><span class="identifier">shared_ptr_type</span><span class="special">));</span>
+<span class="identifier">T</span><span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">reset</span><span class="special">();</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+</dd>
+<dt><span class="term">Mimic shared_ptr</span></dt>
+<dd>
+<p>
+ From the point of view of the other threads thread_specific_shared_ptr
+ behaves as a shared_ptr lockup. From the point of view of the current
+ thread the stored pointer is located in a shared_pointer, so we can
+ use the shared_ptr deleter feature From shared_ptr takes:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span><span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">reset</span><span class="special">();</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">d</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">A</span> <span class="identifier">a</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+</dd>
+<dt><span class="term">Why doesn't thread_specific_shared_ptr
+ provide a release() function?</span></dt>
+<dd><p>
+ As it store a shared_ptr, it cannot give away ownership unless it's
+ unique() because the other copy will still destroy the object.
+ </p></dd>
+</dl>
+</div>
+<a name="toward_boost_interthreads.appendices.rationale.thread_specific_storage.comparaing_tsss_and_tss"></a><h5>
+<a name="id4855813"></a>
+ <a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_specific_storage.comparaing_tsss_and_tss">Comparaing
+ TSSS and TSS</a>
+ </h5>
+<div class="table">
+<a name="id4855829"></a><p class="title"><b>Table 1. Comparaing TSSS and TSS</b></p>
+<table class="table" summary="Comparaing TSSS and TSS">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Feature
+ </p>
+ </th>
+<th>
+ <p>
+ thread_specific_shared_ptr
+ </p>
+ </th>
+<th>
+ <p>
+ thread_specific_ptr
+ </p>
+ </th>
+<th>
+ <p>
+ Compatible
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ ownership
+ </p>
+ </td>
+<td>
+ <p>
+ shared
+ </p>
+ </td>
+<td>
+ <p>
+ exclusive
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ default constructor
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cleanup constructor
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>: can not delete the pointer
+ </p>
+ </td>
+<td>
+ <p>
+ yes:must delete the pointer
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">-&gt;()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">*()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">(</span><span class="identifier">T</span><span class="special">*)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span><span class="special">*)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span><span class="special">*,</span><span class="identifier">D</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span><span class="special">*,</span><span class="identifier">D</span><span class="special">,</span><span class="identifier">A</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">release</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">get_mutex</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">get_map</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">[]()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">wait_and_get</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.rationale.keep_alive"></a><a href="rationale.html#toward_boost_interthreads.appendices.rationale.keep_alive" title="Keep
+ Alive">Keep
+ Alive</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Can a thread that has just do a check
+ point be considered as dead less than one second after?</span></dt>
+<dd><p>
+ Whell this depends on the enabling parameters. If the checking parameter
+ is greater than one it could be possible that the thread do a check_point
+ just before the keep alive manager do the check, seen that there are
+ not enough check_points and declaring the thread dead. If you want
+ to avoid this situation let the checkin to 1.
+ </p></dd>
+<dt><span class="term">Nesting enablers and disablers</span></dt>
+<dd><p>
+ Enablers/disablers use RAII, so they can be nested and the context
+ be restored on the destructor.
+ </p></dd>
+<dt><span class="term">Configurable on dead action</span></dt>
+<dd><p>
+ The default action is to abort the process because I don't see any
+ generic and cleaner way to manage this event. The library provides
+ this hook for user wanting to try something specific.
+ </p></dd>
+<dt><span class="term">Who control the controler?</span></dt>
+<dd><p>
+ There is no way to control this thread other than adding an external
+ process.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.rationale.thread_tuple"></a><a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_tuple" title="Thread
+ Tuple">Thread
+ Tuple</a>
+</h4></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Why must be not copiable?</span></dt>
+<dd><p>
+ Thread tuples can not be copiable since boost::thread is not copiable.
+ </p></dd>
+<dt><span class="term">Why should be movable?</span></dt>
+<dd><p>
+ If we want functions to return Thread tuples it is necessary to make
+ them movable.
+ </p></dd>
+<dt><span class="term">Mimic boost::thread_group</span></dt>
+<dd>
+<p>
+ thread_tuple has in common some function found in thread_group. From
+ it we take
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+<span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</dd>
+<dt><span class="term">Mimic boost::thread</span></dt>
+<dd>
+<p>
+ We can consider a thread tuple as a compound thread, and so we can
+ mimic the thread intyerface. From it we takes
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">join</span><span class="special">();</span>
+<span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">();</span>
+<span class="keyword">void</span> <span class="identifier">detach</span><span class="special">/</span><span class="identifier">detach_all</span><span class="special">();</span>
+<span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">timed_join</span><span class="special">/</span><span class="identifier">timed_join_all</span><span class="special">();</span>
+<span class="keyword">bool</span> <span class="identifier">joinable</span><span class="special">/</span><span class="identifier">all_joinable</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</dd>
+<dt><span class="term">Why the user can not modify directly
+ the embeeded threads?</span></dt>
+<dd>
+<p>
+ </p>
+<p>
+ The library provides a safe function to get a constant thread reference
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">thread</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
+<p>
+ </p>
+<p>
+ The problem if we provide the non constant variant is that the user
+ can detach them.
+ </p>
+<p>
+ </p>
+</dd>
+<dt><span class="term">Joining the first finishing thread
+ of a thread tuple</span></dt>
+<dd><p>
+ This functionallity has a price. We need to synchronize all the threads
+ transparently, so we need to wrap the user thread functions.
+ </p></dd>
+</dl>
+</div>
+<a name="toward_boost_interthreads.appendices.rationale.thread_tuple.comparaing_thread__thread_group_and_thread_tuple"></a><h5>
+<a name="id4857229"></a>
+ <a href="rationale.html#toward_boost_interthreads.appendices.rationale.thread_tuple.comparaing_thread__thread_group_and_thread_tuple">Comparaing
+ thread, thread_group and thread_tuple</a>
+ </h5>
+<div class="table">
+<a name="id4857246"></a><p class="title"><b>Table 2. Comparaing thread, thread_group and thread_tuple</b></p>
+<table class="table" summary="Comparaing thread, thread_group and thread_tuple">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Feature
+ </p>
+ </th>
+<th>
+ <p>
+ thread
+ </p>
+ </th>
+<th>
+ <p>
+ thread_group
+ </p>
+ </th>
+<th>
+ <p>
+ thread_tuple
+ </p>
+ </th>
+<th>
+ <p>
+ Compatible
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ default constructor
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ copiable
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ movable
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">joinable</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no*
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">join</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no*
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">timed_join</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no*
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">interruption_requested</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no*
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">timed_join_all</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no* *
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">join_first_then_interrupt</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no* * *
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">timed_join_first_then_interrupt</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no* * *
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">[]()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>yes</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ no*
+ </p>
+ </td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">*</span></dt>
+<dd><p>
+ thread_group could add these synonym functions
+ </p></dd>
+<dt><span class="term">* *</span></dt>
+<dd><p>
+ thread could add the size function returning 1
+ </p></dd>
+<dt><span class="term">* * *</span></dt>
+<dd><p>
+ thread &amp; thread_group could add these functions
+ </p></dd>
+</dl>
+</div>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="changes.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="implementation.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tests.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tests.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,58 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Appendix
+ E: Tests</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="acknowledgements.html" title="
+ Appendix D: Acknowledgments">
+<link rel="next" href="tickets.html" title=" Appendix
+ F: Tickets">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="acknowledgements.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="tickets.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.tests"></a><a href="tests.html" title=" Appendix
+ E: Tests"> Appendix
+ E: Tests</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">thread_specific_shared_pointer</span></dt></dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.tests.thread_specific_shared_pointer"></a>thread_specific_shared_pointer
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup></colgroup>
+<tbody></tbody>
+</table></div>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="acknowledgements.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="tickets.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tickets.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/tickets.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,286 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Appendix
+ F: Tickets</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="tests.html" title=" Appendix
+ E: Tests">
+<link rel="next" href="todo.html" title=" Appendix
+ G: Future plans">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tests.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="todo.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.tickets"></a><a href="tickets.html" title=" Appendix
+ F: Tickets"> Appendix
+ F: Tickets</a>
+</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Kind
+ </p>
+ </th>
+<th>
+ <p>
+ Identifier
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Resolution
+ </p>
+ </th>
+<th>
+ <p>
+ State
+ </p>
+ </th>
+<th>
+ <p>
+ Tests
+ </p>
+ </th>
+<th>
+ <p>
+ Version
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ bug
+ </p>
+ </td>
+<td>
+ <p>
+ v0.1#1
+ </p>
+ </td>
+<td>
+ <p>
+ basic_keep_alive example do not link
+ </p>
+ </td>
+<td>
+ <p>
+ Add to the link
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+<td>
+ <p>
+ See basic_keep_alive.cpp example
+ </p>
+ </td>
+<td>
+ <p>
+ v0.2
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ bug
+ </p>
+ </td>
+<td>
+ <p>
+ v0.1.1#1
+ </p>
+ </td>
+<td>
+ <p>
+ keep alive mechanism crash when setting set_on_dead_thread before
+ enabling the mechanism
+ </p>
+ </td>
+<td>
+ <p>
+ This was due to the fact that there were no default data for the
+ backup.
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+<td>
+ <p>
+ See basic_keep_alive.cpp example
+ </p>
+ </td>
+<td>
+ <p>
+ v0.4
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ bug
+ </p>
+ </td>
+<td>
+ <p>
+ v0.1.1#2
+ </p>
+ </td>
+<td>
+ <p>
+ keep alive mechanism do not detect dead threads
+ </p>
+ </td>
+<td>
+ <p>
+ We need to reset the counters only when the period is 0.
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+<td>
+ <p>
+ See basic_keep_alive.cpp example
+ </p>
+ </td>
+<td>
+ <p>
+ v0.4
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ bug
+ </p>
+ </td>
+<td>
+ <p>
+ v0.1.1#3
+ </p>
+ </td>
+<td>
+ <p>
+ The set_on_dead_thread setting is not recovered by embeeding enablers/disablers
+ </p>
+ </td>
+<td>
+ <p>
+ The problem is that the on_dead and th thread pointer were stored
+ on the backup. It is enough to store them on the
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+<td>
+ <p>
+ See basic_keep_alive.cpp example
+ </p>
+ </td>
+<td>
+ <p>
+ v0.4
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ bug
+ </p>
+ </td>
+<td>
+ <p>
+ v0.2.0#1
+ </p>
+ </td>
+<td>
+ <p>
+ xxx
+ </p>
+ </td>
+<td>
+ <p>
+ xx
+ </p>
+ </td>
+<td>
+ <p>
+ Open
+ </p>
+ </td>
+<td>
+ <p>
+ xxx
+ </p>
+ </td>
+<td>
+ <p>
+ v0.4.1
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tests.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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="todo.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/todo.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/appendices/todo.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,251 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Appendix
+ G: Future plans</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../appendices.html" title="Appendices">
+<link rel="prev" href="tickets.html" title=" Appendix
+ F: Tickets">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tickets.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.appendices.todo"></a><a href="todo.html" title=" Appendix
+ G: Future plans"> Appendix
+ G: Future plans</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review">Tasks
+ to do before review</a></span></dt>
+<dt><span class="section"><a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases">For
+ later releases</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.todo.tasks_to_do_before_review"></a><a href="todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review" title="Tasks
+ to do before review">Tasks
+ to do before review</a>
+</h4></div></div></div>
+<a name="toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.complete_the_tests"></a><h5>
+<a name="id4858992"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.complete_the_tests">Complete
+ the tests</a>
+ </h5>
+<p>
+ Even if the current release include some test there is yet a long way before
+ been able to review the library.]]
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ change the test so they take less time using locks; conditions and variables.
+ </li>
+<li>
+ Add test with functions throwing
+ </li>
+<li>
+ Formalize the tests for thread_decoratoor
+ </li>
+<li>
+ Formalize the tests for thread_specific_shared_ptr
+ </li>
+<li>
+ Add tests for keep alive mechanism
+ </li>
+</ul></div>
+<a name="toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.add_more_examples"></a><h5>
+<a name="id4859047"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.add_more_examples">Add
+ more examples</a>
+ </h5>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Complete the STM example.
+ </li>
+<li>
+ Change the implementation of the file on the async_ostream.
+ </li>
+</ul></div>
+<a name="toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.change_the_rational_and_implementation_sections"></a><h5>
+<a name="id4859085"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.tasks_to_do_before_review.change_the_rational_and_implementation_sections">Change
+ the rational and implementation sections</a>
+ </h5>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases"></a><a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases" title="For
+ later releases">For
+ later releases</a>
+</h4></div></div></div>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.add_c__0x_move_semantics_on_compilers_supporting_it_and_use_the_boost_move_emulation_otherwise"></a><h5>
+<a name="id4859127"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.add_c__0x_move_semantics_on_compilers_supporting_it_and_use_the_boost_move_emulation_otherwise">Add
+ C++0x move semantics on compilers supporting it and use the Boost.Move
+ emulation otherwise</a>
+ </h5>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.use_c__0x_variadic_templates_on_compilers_supporting_it_and_use_the_preprocesor_otherwise"></a><h5>
+<a name="id4859157"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.use_c__0x_variadic_templates_on_compilers_supporting_it_and_use_the_preprocesor_otherwise">Use
+ C++0x variadic templates on compilers supporting it and use the preprocesor
+ otherwise</a>
+ </h5>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.use_c__0x_concepts_on_compilers_supporting_them_and_use_the_boost_conceptcheck_or_boost_concepttraits_otherwise"></a><h5>
+<a name="id4859188"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.use_c__0x_concepts_on_compilers_supporting_them_and_use_the_boost_conceptcheck_or_boost_concepttraits_otherwise">Use
+ C++0x Concepts on compilers supporting them and use the Boost.ConceptCheck
+ or Boost.ConceptTraits otherwise</a>
+ </h5>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.add_a_daemon_controlling_all_the_keep_alive_controller_threads"></a><h5>
+<a name="id4859219"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.add_a_daemon_controlling_all_the_keep_alive_controller_threads">Add
+ a daemon controlling all the keep alive controller threads</a>
+ </h5>
+<p>
+ This daemon will send regular keep_alive messages and kill the process
+ when dead.
+ </p>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.optimize_the_tsss_maps_using_intrusive_containers"></a><h5>
+<a name="id4859257"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.optimize_the_tsss_maps_using_intrusive_containers">Optimize
+ the TSSS maps using intrusive containers</a>
+ </h5>
+<a name="toward_boost_interthreads.appendices.todo.for_later_releases.generalize_both_specific_pointers_in_a_template_class_basic_thread_specific_ptr"></a><h5>
+<a name="id4859280"></a>
+ <a href="todo.html#toward_boost_interthreads.appendices.todo.for_later_releases.generalize_both_specific_pointers_in_a_template_class_basic_thread_specific_ptr">Generalize
+ both specific pointers in a template class basic_thread_specific_ptr</a>
+ </h5>
+<p>
+ <span class="bold"><strong>Domain Features</strong></span>
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">ownership: exclusive/shared</span></dt>
+<dd><p>
+ Specifies if the pointer is exclusive to the thread or shared with
+ other threads.
+ </p></dd>
+<dt><span class="term">key range: fixed/variable/mixed </span></dt>
+<dd><p>
+ Specifies how the key range is defined. fixed has an integer range
+ 0..n, variable takes as key the address of the specific_ptr and mixed
+ use a variant of fixed or variable key.
+ </p></dd>
+<dt><span class="term">key creation: eager/lazy</span></dt>
+<dd><p>
+ Specifies how the key is created, eager at construction time, lazy
+ when needed.
+ </p></dd>
+<dt><span class="term">context setting: eager/lazy</span></dt>
+<dd><p>
+ Specifies how the pointer is set, eager at thread initialization time,
+ lazy when needed.
+ </p></dd>
+</dl>
+</div>
+<p>
+ The current <code class="computeroutput"><span class="identifier">thread_specific_ptr</span></code>
+ is exclusive, has a variable key range and so the key is initialized at
+ construction time and explicit context setting by user on the current thread.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_thread_specific_ptr</span><span class="special">&lt;</span><span class="identifier">exclusive</span><span class="special">,</span> <span class="identifier">variable_key_range</span><span class="special">&lt;&gt;,</span> <span class="identifier">eager_context_setting</span><span class="special">&gt;</span> <span class="identifier">thread_specific_ptr</span><span class="special">;</span>
+</pre>
+<p>
+ The current <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span></code>
+ is shared, has a variable key range and so the key is initialized at construction
+ time and explicit context setting by user on the current thread.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_thread_specific_ptr</span><span class="special">&lt;</span><span class="identifier">exclusive</span><span class="special">,</span> <span class="identifier">variable_key_range</span><span class="special">&lt;&gt;,</span> <span class="identifier">eager_context_setting</span><span class="special">&gt;</span> <span class="identifier">thread_specific_ptr</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Design rationale</strong></span>
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_ptr</span></code> uses as key the address
+ of the variable. This has as consequence that the mapping from keys to
+ the thread specific context pointer is much less efficient that the direct
+ access provided by some implementations. In this concern this library would
+ try to improve the performance to this mapping providing direct access
+ keys. As the number of direct access keys must be know at compile time
+ this has a limit on the number of thread specific pointers. A mixed approach
+ would be also provided in which the key could be a fixed one or a variable
+ one. It is up to the user to give an hint of the key sort. When using fixed
+ or mixed keys, there is decision to take related to when the key is created,
+ i.e. eager before the threads starts or lazy when we need it.
+ </p>
+<p>
+ Non-portable: The interfaces of POSIX Pthreads, Solaris threads, and Win32
+ threads are very similar. However, the semantics of Win32 threads are subtly
+ different since they do not provide a reliable means of cleaning up objects
+ allocated in thread-specific storage when a thread exits. Moreover, there
+ is no API to delete a key in Solaris threads. This makes it hard to write
+ portable code among UNIX and Win32 platforms.
+ </p>
+<p>
+ So we need to implement it on top of the underlying OS. The idea is to
+ take a native thread specific pointer which will manage with the fixed,
+ variable and mixed keys. This exactly the approach of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_ptr</span></code>
+ but only for variable keys.
+ </p>
+<p>
+ Just to finish, we need to decide when the context is set, two possibilities:
+ the user sets explicitlly the context when it considers pertinent or the
+ context is created lazily the first time we try to get it. The first approach
+ has the liability that the user needs to ensure that the context is set
+ before get them, but when the context must be set before the function thread
+ starts this is a no issue. The second is safe but has as consequence that
+ every access include a check. In addition the type must be default constructible.
+ </p>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">,</span> <span class="identifier">lazy_setting</span><span class="special">&gt;</span> <span class="identifier">ptr</span><span class="special">;</span>
+</pre>
+<p>
+ The pointer will be initilaized when needed as if we had do
+ </p>
+<pre class="programlisting"><span class="keyword">if</span> <span class="special">(</span><span class="identifier">ptr</span><span class="special">.</span><span class="identifier">get</span><span class="special">()==</span><span class="number">0</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span> <span class="keyword">new</span> <span class="identifier">myclass</span><span class="special">()</span> <span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Between the features:
+ </p>
+<p>
+ Thread_specific key mapping optimization: Replace the Boost.Thread thread_specific_ptr
+ thread specific key mapping implementation by a mix of fixed/variable mapping
+ which will provide efficient access to the fixed keys and scalability with
+ the others keys.
+ </p>
+<p>
+ Configuration the fixed/variable/mixed key range, ordered/unordered map,
+ intrusive/extrusive map, shared/exclusive locking.
+ </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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tickets.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.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>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Examples</title>
+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="prev" href="reference/thread_array_reference.html" title="Thread
+ Array Reference">
+<link rel="next" href="examples/thread_safe_deferred_traces.html" title="Thread
+ safe deferred traces">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="reference/thread_array_reference.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="examples/thread_safe_deferred_traces.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="toward_boost_interthreads.examples"></a>Examples
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="examples/thread_safe_deferred_traces.html">Thread
+ safe deferred traces</a></span></dt>
+<dt><span class="section"> STM</span></dt>
+</dl></div>
+<p>
+ This section do includes complete examples using the library.
+ </p>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="reference/thread_array_reference.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="examples/thread_safe_deferred_traces.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/stm.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/stm.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,357 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> STM</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../examples.html" title="Examples">
+<link rel="prev" href="thread_safe_deferred_traces.html" title="Thread
+ safe deferred traces">
+<link rel="next" href="../appendices.html" title="Appendices">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="thread_safe_deferred_traces.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.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="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.examples.stm"></a> STM
+</h3></div></div></div>
+<p>
+ This section does not include a complete example using the library, but only
+ a case study that could use the library in some way. I'm curently working
+ on this.
+ </p>
+<p>
+ Transactional memory (TM) is a recent parallel programming concept which
+ reduces challenges found in parallel programming. TM offers numerous advantages
+ over other synchronization mechanisms.
+ </p>
+<p>
+ This case study contains some thoughts on how I see a "boostified"
+ version of DracoSTM, a software transactional memory (STM) system. DracoSTM
+ is a high performance lock-based C++ STM research library. DracoSTM uses
+ only native object-oriented language semantics, increasing its intuitiveness
+ for developers while maintaining high programmability via automatic handling
+ of composition, locks and transaction termination.
+ </p>
+<p>
+ The example will show only the part concerning how the different contexts
+ are stored.
+ </p>
+<p>
+ Let me start of with a typical use of this library with the Hello World!
+ of transactional concurrent programming, Bank accounts and transfers. Let
+ BankAccount be a simple account.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">BankAccount</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">Deposit</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">Withdraw</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">);</span>
+ <span class="keyword">int</span> <span class="identifier">GetBalance</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+<span class="keyword">void</span> <span class="identifier">Transfer</span><span class="special">(</span><span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">inA</span><span class="special">,</span> <span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">outA</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">amount</span><span class="special">);</span>
+<span class="keyword">class</span> <span class="identifier">AccountManager</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">checkingAcct_</span><span class="special">;</span>
+ <span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">savingsAcct_</span><span class="special">;</span>
+ <span class="identifier">AccountManager</span><span class="special">(</span><span class="identifier">BankAccount</span><span class="special">&amp;</span> <span class="identifier">checking</span><span class="special">,</span> <span class="identifier">BankAccount</span><span class="special">&amp;</span> <span class="identifier">savings</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">checkingAcct_</span><span class="special">(&amp;</span><span class="identifier">checking</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">savingsAcct_</span><span class="special">(&amp;</span><span class="identifier">savings</span><span class="special">)</span>
+ <span class="special">{}</span>
+ <span class="keyword">void</span> <span class="identifier">Checking2Savings</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">Transfer</span><span class="special">(</span><span class="identifier">checkingAcct_</span><span class="special">,</span> <span class="identifier">savingsAcct_</span><span class="special">,</span> <span class="identifier">amount</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ And here a little programm that emulates an employer and two employees behaviors.
+ The employees have requested the employer to transfer their salaries to their
+ checking accounts every month. The employer does the transfer on the 28th
+ of each month. The employees perform withdrawals and queries from their accounts
+ using an ATM. Some people have requested the Bank for automatic periodic
+ transfers from their checking accounts to their saving accounts. The transfer
+ is done on the 3rd of each month.
+ </p>
+<pre class="programlisting"><span class="identifier">BankAccount</span> <span class="special">*</span><span class="identifier">emp</span><span class="special">;</span>
+<span class="identifier">BankAccount</span> <span class="special">*</span><span class="identifier">c1</span><span class="special">;</span>
+<span class="identifier">BankAccount</span> <span class="special">*</span><span class="identifier">c2</span><span class="special">;</span>
+<span class="identifier">BankAccount</span> <span class="special">*</span><span class="identifier">s1</span><span class="special">;</span>
+<span class="identifier">AccountManager</span> <span class="special">*</span><span class="identifier">am1</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">employer_th</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">day</span><span class="special">(</span><span class="number">28</span><span class="special">));</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span><span class="identifier">i</span><span class="special">&lt;</span><span class="number">2</span><span class="special">;++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">Transfer</span><span class="special">(</span><span class="identifier">emp</span><span class="special">,</span> <span class="identifier">c1</span><span class="special">,</span> <span class="number">3000</span><span class="special">);</span>
+ <span class="identifier">Transfer</span><span class="special">(</span><span class="identifier">emp</span><span class="special">,</span> <span class="identifier">c2</span><span class="special">,</span> <span class="number">3200</span><span class="special">);</span>
+ <span class="identifier">sleep</span><span class="special">(</span><span class="identifier">month</span><span class="special">(</span><span class="number">1</span><span class="special">));</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">people_1_th</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">day</span><span class="special">(</span><span class="number">1</span><span class="special">));</span>
+ <span class="identifier">c1</span><span class="special">-&gt;</span><span class="identifier">Withdraw</span><span class="special">(</span><span class="number">100</span><span class="special">);</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">day</span><span class="special">(</span><span class="number">5</span><span class="special">));</span>
+ <span class="identifier">c1</span><span class="special">-&gt;</span><span class="identifier">Withdraw</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">day</span><span class="special">(</span><span class="number">4</span><span class="special">));</span>
+ <span class="identifier">c1</span><span class="special">-&gt;</span><span class="identifier">Withdraw</span><span class="special">(</span><span class="number">200</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">automatic_transfer_th</span><span class="special">(</span><span class="identifier">AccountManager</span> <span class="special">*</span><span class="identifier">am</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">debit</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">day</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span><span class="identifier">i</span><span class="special">&lt;</span><span class="number">2</span><span class="special">;++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">am</span><span class="special">.</span><span class="identifier">Checking2Savings</span><span class="special">(</span><span class="identifier">debit</span><span class="special">);</span>
+ <span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">month</span><span class="special">(</span><span class="number">1</span><span class="special">));</span>
+ <span class="special">};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Evidently every operation must be atomic. We use the STM_ATOMIC and STM_END_ATOMIC
+ macors to hide all the transaction complexity
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">BankAccount</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">balance_</span><span class="special">;</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">Deposit</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">balance_</span> <span class="special">+=</span> <span class="identifier">amount</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">STM_END_ATOMIC</span>
+ <span class="special">}</span>
+ <span class="comment">// ...
+</span>
+<span class="special">};</span>
+</pre>
+<p>
+ How all this works? Let me write what what is begind these macros. These
+ macros use a trick to that ensure that when the statement between both macros
+ succeed the transaction is committed. As the transaction can fail (exception
+ transaction_aborted thrown) we need to reiterate the execution of the statement.
+ So what a user needs to write is something like
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">Deposit</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">stm</span><span class="special">::</span><span class="identifier">transaction</span> <span class="identifier">t</span><span class="special">;</span> <span class="special">!</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">commited</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">restart</span><span class="special">();</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">no_throw_commit</span><span class="special">())</span> <span class="special">{</span>
+ <span class="keyword">try</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">balance_</span> <span class="special">+=</span> <span class="identifier">amount</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="identifier">stm</span><span class="special">::</span><span class="identifier">transaction_aborted</span><span class="special">&amp;)</span> <span class="special">{}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ 1. creation of a new transaction 2.a if not commited restart the transaction
+ and enter the body of the for (3) 2.b if commited exit the for. 3. execute
+ the statement 4 catch stm::transaction_aborted - if a stm::transaction_aborted
+ is thrown the next commit will fail 5. do a no_throw commit (2)
+ </p>
+<p>
+ Next follows the definition of the STM_ATOMIC and STM_END_ATOMIC macros.
+ </p>
+<p>
+ To access this in the current transaction we use <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span></code>
+ which return a smart pointer.
+ </p>
+<p>
+ If there is a large use of t.wr_ptr(this) it is better to use a variable
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">stm</span><span class="special">::</span><span class="identifier">tx_wr_ptr</span><span class="special">&lt;</span><span class="identifier">BankAccount</span><span class="special">&gt;</span> <span class="identifier">this_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">,</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">this_ptr</span><span class="special">-&gt;</span><span class="identifier">balance_</span> <span class="special">+=</span> <span class="identifier">amount</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">STM_END_ATOMIC</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The other <code class="computeroutput"><span class="identifier">BankAccount</span></code> functions
+ are coded as expected. Here is the comple code:
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">BankAccount</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">balance_</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">stm</span><span class="special">:;</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">Deposit</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">balance_</span> <span class="special">+=</span> <span class="identifier">amount</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">STM_END_ATOMIC</span>
+ <span class="special">}</span>
+ <span class="keyword">void</span> <span class="identifier">Withdraw</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">balance_</span> <span class="special">-=</span> <span class="identifier">amount</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="keyword">int</span> <span class="identifier">GetBalance</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">make_tx_rd_ptr</span><span class="special">(</span><span class="keyword">this</span><span class="special">,</span><span class="identifier">t</span><span class="special">)-&gt;</span><span class="identifier">balance_</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">STM_END_ATOMIC</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The transfer from accounts is done like:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">Transfer</span><span class="special">(</span><span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">inA</span><span class="special">,</span> <span class="identifier">BankAccount</span><span class="special">*</span> <span class="identifier">outA</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">amount</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">stm</span><span class="special">;</span>
+ <span class="identifier">STM_ATOMIC</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="identifier">inA</span><span class="special">)-&gt;</span><span class="identifier">Withdraw</span><span class="special">(</span><span class="identifier">amount</span><span class="special">);</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">wr_ptr</span><span class="special">(</span><span class="identifier">outA</span><span class="special">)-&gt;</span><span class="identifier">Deposit</span><span class="special">(</span><span class="identifier">amount</span><span class="special">);</span>
+ <span class="special">}</span> <span class="identifier">STM_END_ATOMIC</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The core of all this stuff is <code class="computeroutput"><span class="identifier">stm</span><span class="special">::</span><span class="identifier">transaction</span></code>,
+ <code class="computeroutput"><span class="identifier">stm</span><span class="special">::</span><span class="identifier">tx_wr_ptr</span><span class="special">&lt;&gt;</span></code>
+ and <code class="computeroutput"><span class="identifier">stm</span><span class="special">::</span><span class="identifier">tx_rd_ptr</span><span class="special">&lt;&gt;</span></code>.
+ </p>
+<p>
+ The interface of the transaction class is quite simple:
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">transaction</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">bool</span> <span class="identifier">commit</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">no_throw_commit</span><span class="special">()</span> <span class="keyword">throw</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">abort</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rd_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">wr_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">delete_memory</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">insert_in_new_cache</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="identifier">transaction_state</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">state</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The smart pointer interfaces follows:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">tx_rd_ptr</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">element_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">value_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">*</span> <span class="identifier">pointer</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">reference</span><span class="special">;</span>
+
+ <span class="identifier">tx_rd_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">transaction</span><span class="special">&amp;</span> <span class="identifier">scope</span><span class="special">);</span>
+
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">tx_wr_ptr</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">element_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">value_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">*</span> <span class="identifier">pointer</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">reference</span><span class="special">;</span>
+
+ <span class="identifier">tx_wr_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">transaction</span><span class="special">&amp;</span> <span class="identifier">scope</span><span class="special">);</span>
+
+ <span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">T</span> <span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="keyword">void</span> <span class="identifier">delete_ptr</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Let me start with the simple constructor:
+ </p>
+<pre class="programlisting"><span class="identifier">tx_wr_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">p</span><span class="special">);</span>
+</pre>
+<p>
+ This creates a smart pointer pointing to a specific transaction memory of
+ the current transaction.
+ </p>
+<p>
+ It contains the classic functions of a smart pointer overloaded with <code class="computeroutput"><span class="keyword">const</span></code> or non <code class="computeroutput"><span class="keyword">const</span></code>.
+ </p>
+<pre class="programlisting"><span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="identifier">T</span> <span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <code class="computeroutput"><span class="identifier">tx_wr_ptr</span></code> points to a writable
+ cache. When we use one of the smart pointer operators, the pointers points
+ to a upgraded write cache specific to the transaction. In the example
+ </p>
+<pre class="programlisting"><span class="identifier">this_ptr</span><span class="special">-&gt;</span><span class="identifier">balance_</span> <span class="special">+=</span> <span class="identifier">amount</span><span class="special">;</span>
+</pre>
+<p>
+ the use of <code class="computeroutput"><span class="identifier">this_ptr</span><span class="special">-&gt;</span><span class="identifier">balance_</span></code> on the left hand side of the assignement
+ operator requires a non const access, so the upgrade to writable is done.
+ </p>
+<p>
+ Every <code class="computeroutput"><span class="keyword">new</span></code>/<code class="computeroutput"><span class="keyword">delete</span></code>
+ operation on a transaction must be in some way signaled to the transaction
+ service. The new created objects would be wrapped by a <code class="computeroutput"><span class="identifier">tx_wr_ptr</span><span class="special">&lt;&gt;</span></code> initialized like that;
+ </p>
+<pre class="programlisting"><span class="identifier">tx_wr_ptr</span><span class="special">&lt;</span><span class="identifier">BankAccount</span><span class="special">&gt;</span> <span class="identifier">this_ptr</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">BackAccount</span><span class="special">(),</span> <span class="identifier">is_new</span><span class="special">);</span>
+</pre>
+<p>
+ When we want to delete a pointer in a transaction we use <code class="computeroutput"><span class="identifier">tx_wr_ptr</span><span class="special">::</span><span class="identifier">delete_ptr</span></code>
+ </p>
+<pre class="programlisting"><span class="identifier">tx_wr_ptr</span><span class="special">&lt;</span><span class="identifier">BankAccount</span><span class="special">&gt;</span> <span class="identifier">p_ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">,</span> <span class="identifier">t</span><span class="special">);</span>
+<span class="comment">// ...
+</span><span class="identifier">p_ptr</span><span class="special">.</span><span class="identifier">delete_ptr</span><span class="special">();</span>
+</pre>
+<p>
+ or the short-cut
+ </p>
+<pre class="programlisting"><span class="identifier">t</span><span class="special">.</span><span class="identifier">delete_ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">);</span>
+</pre>
+<p>
+ Before finishing with the <code class="computeroutput"><span class="identifier">transaction</span></code>
+ class let me show you the <code class="computeroutput"><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>
+ and its base class <code class="computeroutput"><span class="identifier">transactional_object_cache_base</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">transaction</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">bool</span> <span class="identifier">commit</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">no_throw_commit</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">abort</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">read</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">write</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">delete_memory</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">transactional_object_cache</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">insert_in_new_cache</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">);</span>
+
+ <span class="identifier">transaction_state</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">state</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="thread_safe_deferred_traces.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.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="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/thread_safe_deferred_traces.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/examples/thread_safe_deferred_traces.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,337 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Thread
+ safe deferred traces</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../examples.html" title="Examples">
+<link rel="prev" href="../examples.html" title="Examples">
+<link rel="next" href="stm.html" title=" STM">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../examples.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.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="stm.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.examples.thread_safe_deferred_traces"></a><a href="thread_safe_deferred_traces.html" title="Thread
+ safe deferred traces">Thread
+ safe deferred traces</a>
+</h3></div></div></div>
+<p>
+ When executing on a multi thread environment, the output lines on std::cout
+ could interleave. We can synchronize these outputs with a global mutex
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">&gt;</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">global_cout_mutex</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="special">...</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span> <span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ This mutex could be the bottleneck of the system. Only one mutex resource
+ for all the user threads.
+ </p>
+<pre class="programlisting">U U
+ /
+ /
+ U ----- R ----- U
+ |
+ |
+ U
+</pre>
+<p>
+ Another approach could be using a queue of output stream buffers for each
+ thread. Each buffer is timestamped with the creation date and there is a
+ concentrator that takes one by one the elements ordered by their timestamp.
+ Only the current thread can push on this queue because it is specific to
+ the thread. There is a single thread, the concentrator, that pops from these
+ queue. In this context we can ensure thread safety without locking as far
+ as the queue has at least two messages.
+ </p>
+<pre class="programlisting">U ----- R ------+
+ \
+ U ----- R ------\
+ \
+ U ----- R -------- C
+ / /
+ U ----- R ------/ /
+ /
+ U ----- R ------+
+</pre>
+<p>
+ This can be encapsulated in an async_ostream class
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">async_ostream</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">iostreams</span><span class="special">::</span><span class="identifier">stream</span><span class="special">&lt;</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">async_ostream_sink</span><span class="special">&gt;</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">char</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">iostreams</span><span class="special">::</span><span class="identifier">sink_tag</span> <span class="identifier">category</span><span class="special">;</span>
+
+ <span class="identifier">async_ostream</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">flush</span><span class="special">();</span>
+<span class="special">};</span>
+
+<span class="keyword">extern</span> <span class="identifier">async_ostream</span> <span class="identifier">cout_</span><span class="special">;</span>
+</pre>
+<p>
+ With this interface the user can use cout_ as it used std::cout.
+ </p>
+<pre class="programlisting"><span class="identifier">cout_</span> <span class="special">&lt;&lt;</span> <span class="string">"Hello World!"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span> <span class="special">;</span>
+</pre>
+<p>
+ All the magic is in the <code class="computeroutput"><span class="keyword">template</span> <span class="keyword">class</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">iostreams</span><span class="special">::</span><span class="identifier">stream</span><span class="special">&lt;&gt;</span></code>. The parameter must be a model of
+ a sink (See Boost.Iostreams). Here it is.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">detail</span> <span class="special">{</span>
+ <span class="keyword">struct</span> <span class="identifier">async_ostream_sink</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">char</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">iostreams</span><span class="special">::</span><span class="identifier">sink_tag</span> <span class="identifier">category</span><span class="special">;</span>
+ <span class="identifier">async_ostream_sink</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">flush</span><span class="special">();</span>
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <span class="identifier">async_ostream_concentrator</span><span class="special">;</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <span class="identifier">async_ostream</span><span class="special">;</span>
+ <span class="keyword">struct</span> <span class="identifier">impl</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">impl</span><span class="special">&gt;</span> <span class="identifier">impl_</span><span class="special">;</span>
+ <span class="special">};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ This class declares the just minimum in order to model a sink. In addition,
+ in order to mask the implementation, the Pimpl idiom is used. The implementation
+ of these functions is straigtforward:
+ </p>
+<pre class="programlisting"><span class="identifier">async_ostream</span><span class="special">::</span><span class="identifier">async_ostream</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">base_type</span><span class="special">(</span><span class="identifier">os</span><span class="special">)</span> <span class="special">{}</span>
+
+<span class="keyword">void</span> <span class="identifier">async_ostream</span><span class="special">::</span><span class="identifier">flush</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">base_type</span><span class="special">::</span><span class="identifier">flush</span><span class="special">();</span>
+ <span class="identifier">async_ostream</span><span class="special">&amp;</span> <span class="identifier">d</span> <span class="special">=</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="identifier">d</span><span class="special">-&gt;</span><span class="identifier">flush</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">async_ostream_sink</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">impl_</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">impl</span><span class="special">(</span><span class="identifier">os</span><span class="special">))</span> <span class="special">{}</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">impl_</span><span class="special">-&gt;</span><span class="identifier">write</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">n</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">flush</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">impl_</span><span class="special">-&gt;</span><span class="identifier">flush</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Let me continue with the handle of the Pimpl pattern:
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">impl</span> <span class="special">{</span>
+ <span class="identifier">impl</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os_</span><span class="special">;</span>
+ <span class="identifier">tsss_type</span> <span class="identifier">tsss_</span><span class="special">;</span>
+ <span class="identifier">priority_queue_type</span> <span class="identifier">queue_</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">thread_</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">);</span>
+
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">terminate</span><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">async_ostream_thread_ctx</span><span class="special">&gt;</span> <span class="identifier">that</span><span class="special">);</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">loop</span><span class="special">(</span><span class="identifier">impl</span><span class="special">*</span> <span class="identifier">that</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Of course we need to store a reference to the final ostream.
+ </p>
+<p>
+ The <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span>
+ <span class="identifier">tsss_</span></code> is used to encapsulate the
+ logic specific to each thread.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">async_ostream_thread_ctx</span><span class="special">&gt;</span> <span class="identifier">tsss_type</span><span class="special">;</span>
+</pre>
+<p>
+ A priority queue <code class="computeroutput"><span class="identifier">queue_</span></code> will
+ be used by the concentrator thread to order the stringstreams by date.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">timestamped</span> <span class="special">{</span>
+ <span class="identifier">system_time</span> <span class="identifier">date_</span><span class="special">;</span>
+ <span class="keyword">unsigned</span> <span class="identifier">seq_</span><span class="special">;</span>
+ <span class="identifier">T</span> <span class="identifier">value_</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">reset_date</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">seq</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">date_</span> <span class="special">=</span> <span class="identifier">system_time</span><span class="special">();</span>
+ <span class="identifier">seq_</span> <span class="special">=</span> <span class="identifier">seq</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">struct</span> <span class="identifier">ptr_comparator_gt</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">timestamped</span><span class="special">*</span> <span class="identifier">value_type</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">const</span> <span class="identifier">value_type</span><span class="special">&amp;</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">value_type</span><span class="special">&amp;</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">(</span><span class="identifier">lhs</span><span class="special">-&gt;</span><span class="identifier">date_</span> <span class="special">&gt;</span> <span class="identifier">rhs</span><span class="special">-&gt;</span><span class="identifier">date_</span><span class="special">)</span> <span class="special">?</span> <span class="keyword">true</span> <span class="special">:</span>
+ <span class="special">(</span><span class="identifier">lhs</span><span class="special">-&gt;</span><span class="identifier">date_</span> <span class="special">==</span> <span class="identifier">rhs</span><span class="special">-&gt;</span><span class="identifier">date_</span><span class="special">)</span> <span class="special">&amp;&amp;</span> <span class="special">(</span><span class="identifier">lhs</span><span class="special">-&gt;</span><span class="identifier">seq_</span> <span class="special">&gt;</span> <span class="identifier">rhs</span><span class="special">-&gt;</span><span class="identifier">seq_</span><span class="special">)?</span> <span class="keyword">true</span><span class="special">:</span><span class="keyword">false</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+<span class="special">};</span>
+
+<span class="keyword">typedef</span> <span class="identifier">timestamped</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span><span class="special">&gt;</span> <span class="identifier">element_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">priority_queue</span><span class="special">&lt;</span><span class="identifier">queue_type</span><span class="special">*,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;</span><span class="identifier">element_type</span><span class="special">*&gt;,</span> <span class="identifier">element_type</span><span class="special">::</span><span class="identifier">ptr_comparator_gt</span><span class="special">&gt;</span> <span class="identifier">priority_queue_type</span><span class="special">;</span>
+</pre>
+<p>
+ In addition to the timestamp <code class="computeroutput"><span class="identifier">date_</span></code>
+ we need a sequence number to order the stringstreams pushed without enough
+ time granularity, e.g. on the same microsecond.
+ </p>
+<p>
+ To finish the field declaration there is the concentrator thread implemented
+ by the loop function.
+ </p>
+<pre class="programlisting"><span class="special">,</span> <span class="identifier">thread_</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">loop</span><span class="special">,</span> <span class="keyword">this</span><span class="special">))</span>
+</pre>
+<p>
+ Comming back to the sink implementation,
+ </p>
+<pre class="programlisting"><span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">impl</span><span class="special">::</span><span class="identifier">impl</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">)</span>
+<span class="special">:</span> <span class="identifier">os_</span><span class="special">(</span><span class="identifier">os</span><span class="special">)</span>
+<span class="special">,</span> <span class="identifier">tsss_</span><span class="special">(</span><span class="identifier">terminate</span><span class="special">)</span>
+<span class="special">,</span> <span class="identifier">thread_</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">loop</span><span class="special">,</span> <span class="keyword">this</span><span class="special">))</span>
+<span class="special">{}</span>
+</pre>
+<p>
+ The terminate cleanup function is used to ensure that the queue is empty
+ before the thread finishes. To avoid optimizations a non const call inc is
+ done while waiting the queue empties.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">impl</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">async_ostream_thread_ctx</span><span class="special">&gt;</span> <span class="identifier">that</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">while</span> <span class="special">(!</span><span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span>
+ <span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">inc</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The central sink function is write. Here instead to lock a mutex the function
+ forwards to the thread specific shared pointer. We will see below how <code class="computeroutput"><span class="identifier">async_ostream_thread_ctx</span></code> handles this call.
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">tsss_</span><span class="special">-&gt;</span><span class="identifier">write</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">n</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ It is time to analyze the thread specific context before seeing how the concentrator
+ is implemented.
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">async_ostream_thread_ctx</span> <span class="special">{</span>
+ <span class="identifier">async_ostream_thread_ctx</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">flush</span><span class="special">();</span>
+ <span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">get</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">queue_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();}</span>
+ <span class="keyword">void</span> <span class="identifier">inc</span><span class="special">()</span> <span class="special">{++</span><span class="identifier">inc_</span><span class="special">;}</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">unsigned</span> <span class="identifier">seq_</span><span class="special">;</span>
+ <span class="identifier">element_type</span> <span class="special">*</span><span class="identifier">current_</span><span class="special">;</span>
+ <span class="identifier">queue_type</span> <span class="identifier">queue_</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span> <span class="identifier">mutex_</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span><span class="special">&amp;</span> <span class="identifier">buffer</span><span class="special">()</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">current_</span><span class="special">-&gt;</span><span class="identifier">value_</span><span class="special">;}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Each thread has a pointer to the current timestamped stringstream wich is
+ used for the current output flow, i.e. by the write function.
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">streamsize</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">buffer</span><span class="special">().</span><span class="identifier">write</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">n</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Once the user does a flush, the current element is pushed on the queue. The
+ <code class="computeroutput"><span class="identifier">sec_</span></code> integer is used as monotonic
+ sequence in conjuntion with the timestamp.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">flush</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">current_</span><span class="special">-&gt;</span><span class="identifier">reset_date</span><span class="special">(</span><span class="identifier">seq_</span><span class="special">);</span>
+ <span class="special">++</span><span class="identifier">seq_</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">size</span><span class="special">()&gt;</span><span class="number">2</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">queue_</span><span class="special">.</span><span class="identifier">push</span><span class="special">(</span><span class="identifier">current_</span><span class="special">);</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">&gt;</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex_</span><span class="special">);</span>
+ <span class="identifier">queue_</span><span class="special">.</span><span class="identifier">push</span><span class="special">(</span><span class="identifier">current_</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="identifier">current_</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">element_type</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+<p>
+ As stated in the introduction, we don't need to lock the mutex if the number
+ of elements in the queue is enough.
+ </p>
+<p>
+ These queue elements will be read by the concentrator using the get function.
+ </p>
+<pre class="programlisting"><span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">size</span><span class="special">()&gt;</span><span class="number">1</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">get_i</span><span class="special">();</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">&gt;</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex_</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">get_i</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+
+<span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">get_i</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">())</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">e</span><span class="special">=</span> <span class="identifier">queue_</span><span class="special">.</span><span class="identifier">front</span><span class="special">();</span>
+ <span class="identifier">queue_</span><span class="special">.</span><span class="identifier">pop</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="identifier">e</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The concentrator loop looks like:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">async_ostream_sink_impl</span><span class="special">::</span><span class="identifier">loop</span><span class="special">(</span><span class="identifier">async_ostream_sink</span><span class="special">::</span><span class="identifier">impl</span><span class="special">*</span> <span class="identifier">that</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os_</span> <span class="special">=</span> <span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">os_</span><span class="special">;</span>
+ <span class="keyword">for</span><span class="special">(;;)</span> <span class="special">{</span>
+ <span class="comment">// sleeps a little bit
+</span> <span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">1</span><span class="special">));</span>
+ <span class="special">{</span> <span class="comment">// scope needed don't remove
+</span> <span class="comment">// lock the map access
+</span> <span class="identifier">tsss_type</span><span class="special">::</span><span class="identifier">lock_type</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">tsss_</span><span class="special">.</span><span class="identifier">get_mutex</span><span class="special">());</span>
+ <span class="keyword">const</span> <span class="identifier">tsss_type</span><span class="special">::</span><span class="identifier">map_type</span><span class="special">&amp;</span> <span class="identifier">tmap</span><span class="special">(</span><span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">tsss_</span><span class="special">.</span><span class="identifier">get_map</span><span class="special">(</span><span class="identifier">lock</span><span class="special">));</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">tsss_type</span><span class="special">::</span><span class="identifier">map_type</span><span class="special">::</span><span class="identifier">const_iterator</span> <span class="identifier">it</span> <span class="special">=</span> <span class="identifier">tmap</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="identifier">it</span> <span class="special">!=</span> <span class="identifier">tmap</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">++</span><span class="identifier">it</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// takes the first element of each thread queue (if it exists) and push it on the ordered queue.
+</span> <span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">e</span><span class="special">=</span> <span class="identifier">it</span><span class="special">-&gt;</span><span class="identifier">second</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">();</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">e</span> <span class="special">!=</span> <span class="number">0</span><span class="special">)</span> <span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">push</span><span class="special">(</span><span class="identifier">e</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="comment">//when the queue is empty sleeps a little more
+</span> <span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">10</span><span class="special">));</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="comment">// takes the fist element of the ordered queue, write them on the output stream and delete it.
+</span> <span class="identifier">element_type</span><span class="special">*</span> <span class="identifier">e</span> <span class="special">=</span> <span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">top</span><span class="special">();</span>
+ <span class="identifier">that</span><span class="special">-&gt;</span><span class="identifier">queue_</span><span class="special">.</span><span class="identifier">pop</span><span class="special">();</span>
+ <span class="identifier">os_</span> <span class="special">&lt;&lt;</span> <span class="string">"["</span><span class="special">&lt;&lt;</span> <span class="identifier">e</span><span class="special">-&gt;</span><span class="identifier">date_</span> <span class="special">&lt;&lt;</span><span class="string">"-"</span> <span class="special">&lt;&lt;</span> <span class="identifier">e</span><span class="special">-&gt;</span><span class="identifier">seq_</span> <span class="special">&lt;&lt;</span> <span class="string">"] "</span> <span class="special">&lt;&lt;</span> <span class="identifier">e</span><span class="special">-&gt;</span><span class="identifier">value_</span><span class="special">.</span><span class="identifier">str</span><span class="special">();</span>
+ <span class="keyword">delete</span> <span class="identifier">e</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../examples.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.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="stm.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,180 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Overview</title>
+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="prev" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="next" href="overview/motivation.html" title=" Motivation">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="overview/motivation.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="toward_boost_interthreads.overview"></a> Overview
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Motivation</span></dt>
+<dd><dl>
+<dt><span class="section">Decorators</span></dt>
+<dt><span class="section"><a href="overview/motivation.html#toward_boost_interthreads.overview.motivation.sharing_thread_local_storage">Sharing
+ Thread Local Storage</a></span></dt>
+<dt><span class="section"><a href="overview/motivation.html#toward_boost_interthreads.overview.motivation.keep_alive_motivation">
+ Keep Alive</a></span></dt>
+<dt><span class="section"><a href="overview/motivation.html#toward_boost_interthreads.overview.motivation.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></dd>
+</dl></div>
+<a name="toward_boost_interthreads.overview.description"></a><h3>
+<a name="id4803164"></a>
+ Description
+ </h3>
+<p>
+ <span class="bold"><strong>Boost.InterThreads</strong></span> extends Boost.Threads adding some features:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ A thread_decoration class allowing to define setup/cleanup functions which
+ will be called only once by thread (if the thread function is decorated with
+ thread_decorator): setup before the thread function and cleanup at thread
+ exit. It is used together with asynchronous_executor_decorator
+ </li>
+<li>
+ A thread_decorator/thread_decorate class/function which decorate a thread
+ function in order to call the setup and the cleanup of all the thread_decorations.
+ </li>
+<li>
+ A thread specific shared pointer which is an extension of the thread_specific_ptr
+ providing access to this thread specific context from other threads. As it
+ is shared the stored pointer is a shared_ptr instead of a raw one.
+ </li>
+<li>
+ A thread keep alive mechanism: this mechanism allows to detect threads that
+ do not prove that they are alive by calling to the keep_alive_point regularly.
+ When a thread is declared dead a user provided function is called, which
+ by default will abort the program.
+ </li>
+<li>
+ A thread static array
+ <div class="itemizedlist"><ul type="circle"><li>
+ thread tuple: defines a thread groupe where the number of threads is
+ know statically and the threads are created at construction time in oposition
+ to a thread_group.
+ </li></ul></div>
+</li>
+<li>
+ A thread static array and a thread group with wait for any feature
+ <div class="itemizedlist"><ul type="circle">
+<li>
+ set_once: a synchonizer that allows to set a variable only once, notifying
+ to the variable value to whatever is waiting for that.
+ </li>
+<li>
+ thread_tuple_once: an extension of the boost::thread_tuple which allows
+ to join the completion of any thread using for that the set_once synchronizer.
+ </li>
+<li>
+ thread_group_once: an extension of the boost::thread_group which allows
+ to join the completion of any thread in the group using for that the
+ set_once synchronizer.
+ </li>
+</ul></div>
+</li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ thread_decorator and thread_specific_shared_ptr are based on the original
+ implementation of threadalert written by Roland Schwarz.
+ </p></td></tr>
+</table></div>
+<a name="toward_boost_interthreads.overview.how_to_use_this_documentation"></a><h3>
+<a name="id4764766"></a>
+ <a href="overview.html#toward_boost_interthreads.overview.how_to_use_this_documentation">How
+ to Use This Documentation</a>
+ </h3>
+<p>
+ This documentation makes use of the following naming and formatting conventions.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Code is in <code class="computeroutput"><span class="identifier">fixed</span> <span class="identifier">width</span>
+ <span class="identifier">font</span></code> and is syntax-highlighted.
+ </li>
+<li>
+ Replaceable text that you will need to supply is in
+ <em class="replaceable"><code>
+ italics
+ </code></em>
+ .
+ </li>
+<li>
+ If a name refers to a free function, it is specified like this: <code class="computeroutput"><span class="identifier">free_function</span><span class="special">()</span></code>;
+ that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code>
+ to indicate that it is a free function.
+ </li>
+<li>
+ If a name refers to a class template, it is specified like this: <code class="computeroutput"><span class="identifier">class_template</span><span class="special">&lt;&gt;</span></code>;
+ that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special">&lt;&gt;</span></code>
+ to indicate that it is a class template.
+ </li>
+<li>
+ If a name refers to a function-like macro, it is specified like this: <code class="computeroutput"><span class="identifier">MACRO</span><span class="special">()</span></code>;
+ that is, it is uppercase in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code> to indicate that it is a function-like
+ macro. Object-like macros appear without the trailing <code class="computeroutput"><span class="special">()</span></code>.
+ </li>
+<li>
+ Names that refer to <span class="emphasis"><em>concepts</em></span> in the generic programming
+ sense are specified in CamelCase.
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ In addition, notes such as this one specify non-essential information that
+ provides additional background or rationale.
+ </p></td></tr>
+</table></div>
+<p>
+ Finally, you can mentally add the following to any code fragments in this document:
+ </p>
+<pre class="programlisting"><span class="comment">// Include all of InterThreads
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="comment">// Create a namespace aliases
+</span><span class="keyword">namespace</span> <span class="identifier">bith</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">;</span>
+</pre>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="overview/motivation.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview/motivation.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/overview/motivation.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,271 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Motivation</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../overview.html" title=" Overview">
+<link rel="prev" href="../overview.html" title=" Overview">
+<link rel="next" href="../users_guide.html" title=" Users'Guide">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.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="../users_guide.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.overview.motivation"></a> Motivation
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Decorators</span></dt>
+<dt><span class="section"><a href="motivation.html#toward_boost_interthreads.overview.motivation.sharing_thread_local_storage">Sharing
+ Thread Local Storage</a></span></dt>
+<dt><span class="section"><a href="motivation.html#toward_boost_interthreads.overview.motivation.keep_alive_motivation">
+ Keep Alive</a></span></dt>
+<dt><span class="section"><a href="motivation.html#toward_boost_interthreads.overview.motivation.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.overview.motivation.decorators"></a>Decorators
+</h4></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_once</span></code> provides a mechanism for ensuring
+ that an initialization routine is run exactly once on a programm without
+ data races or deadlocks. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">at_thread_exit</span></code>
+ allows to execute a cleanup function at thread exit.
+ </p>
+<p>
+ If we want a setup function to be executed once at the begining on the
+ threads and a cleanup at thread exit we need to do
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">thread_main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">setup</span><span class="special">();</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">at_thread_exit</span><span class="special">(</span><span class="identifier">cleanup</span><span class="special">);</span>
+ <span class="comment">// do whatever
+</span> <span class="comment">// ...
+</span><span class="special">}</span>
+<span class="comment">// ...
+</span><span class="special">{</span>
+ <span class="identifier">launch</span><span class="special">(</span><span class="identifier">thread_main</span><span class="special">);</span>
+ <span class="comment">//...
+</span><span class="special">}</span>
+</pre>
+<p>
+ Of course we can define an init function that calls setup and do the registration.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">init</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">setup</span><span class="special">();</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">at_thread_exit</span><span class="special">(</span><span class="identifier">cleanup</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Different services could require these setup/cleanup functions to be called,
+ and so each thread function should do
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">thread_main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">serv1</span><span class="special">::</span><span class="identifier">init</span><span class="special">();</span>
+ <span class="comment">// ...
+</span> <span class="identifier">servN</span><span class="special">::</span><span class="identifier">init</span><span class="special">();</span>
+ <span class="comment">// do whatever using serv1, ..., servN.
+</span> <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+<p>
+ This approach is valid for services that the user can configure for specifics
+ threads, but not for services that must be installed on every thread.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_decoration</span></code> ensures
+ that a setup function is called only once by thread before the thread function
+ provided the thread is created with a decorator wrapper. This setup function
+ is usualy used to set thread specific pointers and call functions once.
+ </p>
+<p>
+ The conterpart of the setup is the cleanup. The <code class="computeroutput"><span class="identifier">thread_decoration</span></code>
+ takes an optional cleanup function which will be executed at thread exit.
+ </p>
+<pre class="programlisting"><span class="comment">// define in only the implementation file of each service
+</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">::</span><span class="identifier">decoration</span> <span class="identifier">serv1</span><span class="special">:</span><span class="identifier">decoration</span><span class="special">(</span><span class="identifier">serv1</span><span class="special">:</span><span class="identifier">setup</span><span class="special">,</span> <span class="identifier">serv1</span><span class="special">:</span><span class="identifier">cleanup</span><span class="special">);</span>
+<span class="comment">// ...
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">::</span><span class="identifier">decoration</span> <span class="identifier">servN</span><span class="special">:</span><span class="identifier">decoration</span><span class="special">(</span><span class="identifier">servN</span><span class="special">:</span><span class="identifier">setup</span><span class="special">,</span> <span class="identifier">servN</span><span class="special">:</span><span class="identifier">cleanup</span><span class="special">);</span>
+
+
+<span class="keyword">void</span> <span class="identifier">thread_main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="comment">// do whatever using serv1, ..., servN.
+</span> <span class="comment">// ...
+</span><span class="special">}</span>
+
+<span class="comment">// ...
+</span><span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">::</span><span class="identifier">make_decorator</span><span class="special">(</span><span class="identifier">thread_main</span><span class="special">));</span>
+ <span class="comment">//...
+</span><span class="special">}</span>
+</pre>
+<p>
+ We can use a basic_threader_decorator as asynchronous executor to fork
+ thread_main.
+ </p>
+<pre class="programlisting"><span class="comment">// ...
+</span><span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">=</span><span class="identifier">fork</span><span class="special">(</span><span class="identifier">basic_threader_decorator</span><span class="special">(),</span> <span class="identifier">thread_main</span><span class="special">);</span>
+ <span class="comment">//...
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.overview.motivation.sharing_thread_local_storage"></a><a href="motivation.html#toward_boost_interthreads.overview.motivation.sharing_thread_local_storage" title="Sharing
+ Thread Local Storage">Sharing
+ Thread Local Storage</a>
+</h4></div></div></div>
+<p>
+ Thread local storage allows multi-threaded applications to have a separate
+ instance of a given data item for each thread. But does not provide any
+ mechanism to access this data from other threads. Although this seems to
+ defeat the whole point of thread-specific storage, it is useful when these
+ contexts need some kind of communication between them, or some central
+ global object needs to control them.
+ </p>
+<p>
+ The intent of the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span></code>
+ class is to allow two threads to establish a shared memory space, without
+ requiring the user code to pass any information. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span></code>
+ provides a portable mechanism for shared thread-local storage that works
+ on all compilers supported by <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span></code>. Each instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span></code> represents
+ a pointer to a shared object where each thread must have a distinct value.
+ </p>
+<p>
+ Only the current thread can modify the thread specific shared pointer using
+ the non const functions reset/release functions. Each time these functions
+ are used, a synchronization must be ensured to update the mapping. The
+ other threads have only read access to the shared_ptr&lt;T&gt;. It is worth
+ saying that the shared object T must be thread safe.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.overview.motivation.keep_alive_motivation"></a><a href="motivation.html#toward_boost_interthreads.overview.motivation.keep_alive_motivation" title="
+ Keep Alive">
+ Keep Alive</a>
+</h4></div></div></div>
+<p>
+ On fault tolerant systems we need to be able to detect threads that could
+ stay on a loop, or simply blocked.
+ </p>
+<p>
+ One way to detect this situations is to require the thread to signal it
+ is alive by calling a check point function. Of course it should be up to
+ the user to state when this mechanism is enabled or disabled. At the begining
+ of a thread the keep alive mechanism is disabled.
+ </p>
+<p>
+ A thread will be considered dead if during a given period the number of
+ checkins is inferior to a given threshold. These two parameters can be
+ given when the keep alive mechanislm is enabled.
+ </p>
+<p>
+ The controler checks at predefined intervals if the thread is dead, and
+ in this case it will call a user specific function which by default aborts
+ the program.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.overview.motivation.thread_tuple"></a><a href="motivation.html#toward_boost_interthreads.overview.motivation.thread_tuple" title="Thread
+ Tuple">Thread
+ Tuple</a>
+</h4></div></div></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">boots</span><span class="special">::</span><span class="identifier">thread_group</span></code> class allows to group dynamically
+ threads. This means that the container must be dynamic.
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_group</span> <span class="identifier">tg</span><span class="special">;</span>
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">create_thread</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">);</span>
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">create_thread</span><span class="special">(</span><span class="identifier">thread2</span><span class="special">);</span>
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">join_all</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code>
+ class is responsible for launching and managing a static collection of
+ threads that are related in some way. No new threads can be added to the
+ tuple once constructed. So we can write
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">tt</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">,</span> <span class="identifier">thread2</span><span class="special">);</span>
+ <span class="identifier">tt</span><span class="special">.</span><span class="identifier">join_all</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ As this
+ </p>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">conc_join_all</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">,</span> <span class="identifier">thread2</span><span class="special">);</span>
+</pre>
+<p>
+ In addition the user can join the first finishing thread.
+ </p>
+<pre class="programlisting"><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">conc_join_any</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">,</span> <span class="identifier">thread2</span><span class="special">);</span>
+</pre>
+<p>
+ Evidently, thread_tuple can not be used when we need dynamic creation or
+ deletion. The <code class="computeroutput"><span class="identifier">boots</span><span class="special">::</span><span class="identifier">thread_group</span></code> class allows to group dynamically
+ threads.
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_group</span> <span class="identifier">tg</span><span class="special">;</span>
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">create_thread</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">);</span>
+
+ <span class="comment">// later on
+</span> <span class="identifier">tg</span><span class="special">.</span><span class="identifier">create_thread</span><span class="special">(</span><span class="identifier">thread2</span><span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th3</span><span class="special">(</span><span class="identifier">thread3</span><span class="special">)</span>
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">add_thread</span><span class="special">(</span><span class="identifier">th3</span><span class="special">);</span>
+
+ <span class="comment">// later on
+</span> <span class="identifier">tg</span><span class="special">.</span><span class="identifier">remove_thread</span><span class="special">(</span><span class="identifier">th3</span><span class="special">);</span>
+
+ <span class="identifier">tg</span><span class="special">.</span><span class="identifier">join_all</span><span class="special">(</span><span class="identifier">thread1</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Objects of type <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code> are movable, so they can be stored
+ in move-aware containers, and returned from functions. This allows the
+ details of thread tuple creation to be wrapped in a function.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">make_thread_tuple</span><span class="special">(...);</span>
+
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">some_thread_tuple</span><span class="special">=</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_thread_tuple</span><span class="special">(</span><span class="identifier">f1</span><span class="special">,</span> <span class="identifier">g2</span><span class="special">);</span>
+ <span class="identifier">some_thread_tuple</span><span class="special">.</span><span class="identifier">join</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.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="../users_guide.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,71 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Reference</title>
+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="prev" href="users_guide/glosary.html" title=" Glossary">
+<link rel="next" href="reference/concepts.html" title="Concepts">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="users_guide/glosary.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="reference/concepts.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="toward_boost_interthreads.reference"></a> Reference
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Concepts</span></dt>
+<dd><dl><dt><span class="section">Decorator</span></dt></dl></dd>
+<dt><span class="section"><a href="reference/thread_extensions_reference.html">Thread
+ Extensions Reference</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference/thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decoration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_keep_alive</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference/thread_array_reference.html">Thread
+ Array Reference</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference/thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">set_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_group_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></dd>
+</dl></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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="users_guide/glosary.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="reference/concepts.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/concepts.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/concepts.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Concepts</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../reference.html" title=" Reference">
+<link rel="prev" href="../reference.html" title=" Reference">
+<link rel="next" href="thread_extensions_reference.html" title="Thread
+ Extensions Reference">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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_extensions_reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.reference.concepts"></a>Concepts
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">Decorator</span></dt></dl></div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.concepts.decorator"></a>Decorator
+</h4></div></div></div></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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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_extensions_reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_array_reference.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_array_reference.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,1429 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Thread
+ Array Reference</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../reference.html" title=" Reference">
+<link rel="prev" href="thread_extensions_reference.html" title="Thread
+ Extensions Reference">
+<link rel="next" href="../examples.html" title="Examples">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="thread_extensions_reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../examples.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference"></a><a href="thread_array_reference.html" title="Thread
+ Array Reference">Thread
+ Array Reference</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">set_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp.set_onceclass">
+ Template Class <code class="computeroutput"><span class="identifier">set_once</span><span class="special">&lt;&gt;</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_make_thread_tuple">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_make_thread_tuple_once">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple_once</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_group_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_make_thread_group_once">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_group_once</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.set_once_hpp"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp" title="
+ Header &lt;boost/interthreads/set_once.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">set_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp.set_onceclass">
+ Template Class <code class="computeroutput"><span class="identifier">set_once</span><span class="special">&lt;&gt;</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">set_once</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.set_once_hpp.set_onceclass"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.set_once_hpp.set_onceclass" title="
+ Template Class set_once&lt;&gt;">
+ Template Class <code class="computeroutput"><span class="identifier">set_once</span><span class="special">&lt;&gt;</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">set_once</span><span class="special">&lt;&gt;</span></code>
+ is a synchonizer that allows to set a variable only once, notifying to
+ the variable value to whatever is waiting for that.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">set_once</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">value_type</span><span class="special">;</span>
+
+ <span class="identifier">set_once</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">wait</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="keyword">bool</span> <span class="identifier">wait_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">TimeDuration</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="identifier">value_type</span> <span class="identifier">get</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">value_type</span><span class="special">&gt;</span> <span class="identifier">get_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">value_type</span><span class="special">&gt;</span> <span class="identifier">get_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">TimeDuration</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="keyword">bool</span> <span class="identifier">set_if_unassigned</span><span class="special">(</span><span class="identifier">value_type</span> <span class="identifier">id</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">decorator</span><span class="special">(</span><span class="identifier">this_type</span><span class="special">&amp;</span> <span class="identifier">once</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">F</span> <span class="identifier">fct</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread</span><span class="special">&gt;</span> <span class="identifier">make_thread</span><span class="special">(</span><span class="identifier">this_type</span><span class="special">&amp;</span> <span class="identifier">once</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">F</span> <span class="identifier">fct</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp" title="
+ Header &lt;boost/interthreads/thread_tuple.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_make_thread_tuple">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">thread_tuple</span><span class="special">;</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;</span> <span class="identifier">make_thread_tuple</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class" title="
+ Template Class thread_tuple&lt;&gt;">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.template_parameters">Template
+ parameters</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_callable_constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_destructor">
+ Destructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_joinable">
+ Member function <code class="computeroutput"><span class="identifier">joinable</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_join">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_until___">Member
+ function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_for___">Member
+ function <code class="computeroutput"><span class="identifier">join_all_for</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.join_first_then_interrupt">
+ Member function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_any_until___">Member
+ function <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.detach_all">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_interrupt_all">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_size">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code>
+ defines a thread groupe where the number of threads is know statically
+ and the threads are created at construction time.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">n</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">thread_tuple</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;</span> <span class="identifier">f</span><span class="special">);</span>
+ <span class="special">~</span><span class="identifier">thread_tuple</span><span class="special">();</span>
+
+ <span class="comment">// move support
+</span> <span class="identifier">thread_tuple</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="identifier">thread_tuple</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;();</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">move</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&amp;</span> <span class="identifier">x</span><span class="special">);</span>
+
+ <span class="keyword">bool</span> <span class="identifier">joinable</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">detach</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+
+ <span class="keyword">const</span> <span class="identifier">thread</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">);</span>
+<span class="special">};</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code>
+ class is responsible for launching and managing a static collection of
+ threads that are related in some fashion. No new threads can be added
+ to the tuple once constructed.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.template_parameters"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.template_parameters" title="Template
+ parameters">Template
+ parameters</a>
+</h6></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code>
+ is instantiated with the following value:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ n is the size of the tuple.
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_callable_constructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_callable_constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+<span class="identifier">thread_tuple</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">func_0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span> <span class="identifier">func_n</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Fk</span></code> must by copyable.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func_k</span></code> is copied
+ into storage managed internally by the library, and that copy is
+ invoked on a newly-created thread of execution. If this invocation
+ results in an exception being propagated into the internals of
+ the library that is not of type <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_interrupted</span></code>,
+ then <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code>
+ will be called.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to the newly created tuple of threads of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
+ occurs.
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Currently up to ten arguments <code class="computeroutput"><span class="identifier">func_0</span></code>
+ to <code class="computeroutput"><span class="identifier">funct_9</span></code> can
+ be specified.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_destructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">thread_tuple</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ If *this have associateds thread of execution, calls detach() on
+ them. Destroys *this.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_joinable"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_joinable" title="
+ Member function joinable()">
+ Member function <code class="computeroutput"><span class="identifier">joinable</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">joinable</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to threads of execution, <code class="computeroutput"><span class="keyword">false</span></code>
+ otherwise.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_join"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_join" title="
+ Member function join_all()">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">join</span><span class="special">();</span>
+<span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_until___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_until___" title="Member
+ function join_all_until()">Member
+ function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">timed_join</span><span class="special">()</span></code> on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code>
+ object in the tuple.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all_until</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_for___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_all_for___" title="Member
+ function join_all_for()">Member
+ function <code class="computeroutput"><span class="identifier">join_all_for</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="keyword">bool</span> <span class="identifier">join_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ As <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">(</span><span class="identifier">now</span><span class="special">()+</span><span class="identifier">rel_time</span><span class="special">)</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all_for</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.join_first_then_interrupt"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.join_first_then_interrupt" title="
+ Member function join_any()">
+ Member function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">conc_join_any</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code>
+ on a temporary thread_tuple and the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code> is one of the predefined interruption
+ points, <code class="computeroutput"><span class="identifier">conc_join_any</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_any_until___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.member_function__join_any_until___" title="Member
+ function join_any_until()">Member
+ function <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">conc_join_any_until</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_for</span><span class="special">(</span>
+ <span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code> on a temporary thread_tuple and
+ the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code> is one of the predefined interruption
+ points, <code class="computeroutput"><span class="identifier">conc_join_any_until</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.detach_all"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.detach_all" title="
+ Member function detach_all()">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">detach</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_interrupt_all"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_interrupt_all" title="
+ Member function interrupt_all()">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">interrupt</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_size"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_class.thread_tuple_size" title="
+ Member function size()">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">size</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ The number of threads in the tuple.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_make_thread_tuple"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_hpp.thread_tuple_make_thread_tuple" title="
+ Non Member Function make_thread_tuple()">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+<span class="identifier">thread_tuple</span> <span class="identifier">make_thread_tuple</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ makes a new thread_tuple&lt;&gt;.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ the created thread tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp" title="
+ Header &lt;boost/interthreads/thread_tuple_once.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_tuple_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_make_thread_tuple_once">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple_once</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">thread_tuple_once</span><span class="special">;</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple</span> <span class="identifier">make_thread_tuple_once</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class" title="
+ Template Class thread_tuple_once&lt;&gt;">
+ Template Class <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.template_parameters">Template
+ parameters</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_callable_constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_destructor">
+ Destructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_joinable">
+ Member function <code class="computeroutput"><span class="identifier">joinables</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_join">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_all_until___">Member
+ function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_any___">Member
+ function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.timed_join_first_then_interrupt">
+ Member function <code class="computeroutput"><span class="identifier">timed_join_first_then_interrupt</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.detach_all">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_interrupt_all">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_size">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">biththread_tuple_once</span></code>
+ is an extension of the <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span></code>
+ which allows to join the thread finishing the first, using for that the
+ <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">set_once</span></code> synchronizer.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">n</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">thread_tuple_once</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple_once</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span>
+ <span class="identifier">thread_tuple_once</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;</span> <span class="identifier">f</span><span class="special">);</span>
+ <span class="special">~</span><span class="identifier">thread_tuple_once</span><span class="special">();</span>
+
+ <span class="comment">// move support
+</span> <span class="identifier">thread_tuple_once</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="identifier">thread_tuple_once</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;();</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_tuple_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">move</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">thread_tuple_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&amp;</span> <span class="identifier">x</span><span class="special">);</span>
+
+ <span class="keyword">bool</span> <span class="identifier">joinables</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">join_any</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_until</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_for</span><span class="special">(</span>
+ <span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+
+ <span class="keyword">const</span> <span class="identifier">thread</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">);</span>
+<span class="special">};</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The __thread_tuple<span class="underline">once</span>_ class is
+ responsible for launching and managing a static collection of threads
+ that are related in some fashion. No new threads can be added to the
+ tuple once constructed.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.template_parameters"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.template_parameters" title="Template
+ parameters">Template
+ parameters</a>
+</h6></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;</span></code>
+ is instantiated with the following value:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ n is the size of the tuple.
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_callable_constructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_callable_constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+<span class="identifier">thread_tuple_once</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">func_0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span> <span class="identifier">func_n</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Fk</span></code> must by copyable.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func_k</span></code> is copied
+ into storage managed internally by the library, and that copy is
+ invoked on a newly-created thread of execution. If this invocation
+ results in an exception being propagated into the internals of
+ the library that is not of type <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_interrupted</span></code>,
+ then <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code>
+ will be called.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to the newly created tuple of threads of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
+ occurs.
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Currently up to ten arguments <code class="computeroutput"><span class="identifier">func_0</span></code>
+ to <code class="computeroutput"><span class="identifier">funct_9</span></code> can
+ be specified.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_destructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">thread_tuple_once</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ If *this have associateds thread of execution, calls detach() on
+ them. Destroys *this.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_joinable"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_joinable" title="
+ Member function joinables()">
+ Member function <code class="computeroutput"><span class="identifier">joinables</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">joinables</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to threads of execution, <code class="computeroutput"><span class="keyword">false</span></code>
+ otherwise.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_join"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_join" title="
+ Member function join_all()">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_all_until___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_all_until___" title="Member
+ function join_all_until()">Member
+ function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="keyword">bool</span> <span class="identifier">join_all_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">timed_join</span><span class="special">()</span></code> on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code>
+ object in the tuple.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;::</span><span class="identifier">timed_join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_any___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.member_function__join_any___" title="Member
+ function join_any()">Member
+ function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">join_any</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join_first</span><span class="special">()</span></code> and the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.timed_join_first_then_interrupt"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.timed_join_first_then_interrupt" title="
+ Member function timed_join_first_then_interrupt()">
+ Member function <code class="computeroutput"><span class="identifier">timed_join_first_then_interrupt</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">timed_join_first_then_interrupt</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">timed_join_first_then_interrupt</span><span class="special">(</span>
+ <span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">timed_join_first</span><span class="special">()</span></code> and the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the tuple has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_tuple_once</span><span class="special">&lt;&gt;::</span><span class="identifier">timed_join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.detach_all"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.detach_all" title="
+ Member function detach_all()">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">detach</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_interrupt_all"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_interrupt_all" title="
+ Member function interrupt_all()">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">interrupt</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_size"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_class.thread_tuple_once_size" title="
+ Member function size()">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">size</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ The number of threads in the tuple.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_make_thread_tuple_once"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_tuple_once_hpp.thread_tuple_once_make_thread_tuple_once" title="
+ Non Member Function make_thread_tuple_once()">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_tuple_once</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+<span class="identifier">thread_tuple_once</span> <span class="identifier">make_thread_tuple_once</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ makes a new thread_tuple_once&lt;&gt;.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ the created thread tuple.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp" title="
+ Header &lt;boost/interthreads/thread_group_once.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_group_once</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class">
+ Template Class <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_make_thread_group_once">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_group_once</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">thread_group</span><span class="special">;</span>
+
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class" title="
+ Template Class thread_group_once&lt;&gt;">
+ Template Class <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_callable_constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_destructor">
+ Destructor</a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_joinable">
+ Member function <code class="computeroutput"><span class="identifier">joinables</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_join">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_timed_join">
+ Member function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.join_first_then_interrupt">
+ Member function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.timed_join_first_then_interrupt">
+ Member function <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.detach_all">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.member_function__interrupt_all___">Member
+ function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_size">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;</span></code>
+ is an extension of the boost::thread_group which allows to join the thread
+ finishing the first, using for that the set_once synchronizer.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">n</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">thread_group_once</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">thread_group_once</span><span class="special">();</span>
+ <span class="special">~</span><span class="identifier">thread_group_once</span><span class="special">();</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F</span><span class="special">&gt;</span>
+ <span class="identifier">thread</span><span class="special">*</span> <span class="identifier">create_thread</span><span class="special">(</span><span class="identifier">F</span> <span class="identifier">threadfunc</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">remove_thread</span><span class="special">(</span><span class="identifier">thread</span><span class="special">*</span> <span class="identifier">thrd</span><span class="special">);</span>
+
+ <span class="comment">// move support
+</span> <span class="identifier">thread_group_once</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_group_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="identifier">thread_group_once</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_group_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">x</span><span class="special">);</span>
+ <span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_group_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;();</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_t</span><span class="special">&lt;</span><span class="identifier">thread_group_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&gt;</span> <span class="identifier">move</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">thread_group_once</span><span class="special">&lt;</span><span class="identifier">n</span><span class="special">&gt;&amp;</span> <span class="identifier">x</span><span class="special">);</span>
+
+ <span class="keyword">bool</span> <span class="identifier">joinables</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="keyword">bool</span> <span class="identifier">join_all_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">join_any</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_until</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_for</span><span class="special">(</span>
+ <span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+
+ <span class="keyword">const</span> <span class="identifier">thread</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">);</span>
+<span class="special">};</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_callable_constructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_callable_constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">thread_group_once</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ creates a thread group.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to the newly created group of threads of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
+ occurs.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_destructor"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">thread_group_once</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ If *this have associateds thread of execution, calls detach() on
+ them. Destroys *this.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_joinable"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_joinable" title="
+ Member function joinables()">
+ Member function <code class="computeroutput"><span class="identifier">joinables</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">joinables</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to threads of execution, <code class="computeroutput"><span class="keyword">false</span></code>
+ otherwise.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_join"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_join" title="
+ Member function join_all()">
+ Member function <code class="computeroutput"><span class="identifier">join_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">join_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the group.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the group has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;::</span><span class="identifier">join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_timed_join"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_timed_join" title="
+ Member function join_all_until()">
+ Member function <code class="computeroutput"><span class="identifier">join_all_until</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">join_all_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="keyword">bool</span> <span class="identifier">join_all_for</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">timed_join</span><span class="special">()</span></code> on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code>
+ object in the group.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the group has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;::</span><span class="identifier">timed_join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.join_first_then_interrupt"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.join_first_then_interrupt" title="
+ Member function join_any()">
+ Member function <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">join_any</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">join_any</span><span class="special">()</span></code>
+ and the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the group has terminated.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">join_any</span></code>
+ is one of the predefined interruption points, <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;::</span><span class="identifier">join_any</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.timed_join_first_then_interrupt"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.timed_join_first_then_interrupt" title="
+ Member function join_any_until()">
+ Member function <code class="computeroutput"><span class="identifier">join_any_until</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_until</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&amp;</span> <span class="identifier">wait_until</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">join_any_for</span><span class="special">(</span>
+ <span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">get_until</span><span class="special">()</span></code> and the <code class="computeroutput"><span class="identifier">interrup_all</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ Every thread in the group has terminated.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ true if joined.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ Since <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span></code> is one of the predefined
+ interruption points, <code class="computeroutput"><span class="identifier">thread_group_once</span><span class="special">&lt;&gt;::</span><span class="identifier">timed_join_all</span><span class="special">()</span></code> is also an interruption point.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.detach_all"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.detach_all" title="
+ Member function detach_all()">
+ Member function <code class="computeroutput"><span class="identifier">detach_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">detach_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">detach</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the group.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.member_function__interrupt_all___"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.member_function__interrupt_all___" title="Member
+ function interrupt_all()">Member
+ function <code class="computeroutput"><span class="identifier">interrupt_all</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_all</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">interrupt</span><span class="special">()</span></code>
+ on each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> object in the group.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_size"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_class.thread_group_once_size" title="
+ Member function size()">
+ Member function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">size</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ The number of threads in the group.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_make_thread_group_once"></a><a href="thread_array_reference.html#toward_boost_interthreads.reference.thread_array_reference.thread_group_once_hpp.thread_group_once_make_thread_group_once" title="
+ Non Member Function make_thread_group_once()">
+ Non Member Function <code class="computeroutput"><span class="identifier">make_thread_group_once</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span>
+<span class="identifier">thread_group_once</span> <span class="identifier">make_thread_group_once</span><span class="special">(</span><span class="identifier">F0</span> <span class="identifier">f0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ makes a new thread_group_once&lt;&gt;.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ the created thread group.
+ </p></dd>
+</dl>
+</div>
+</div>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="thread_extensions_reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../examples.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_extensions_reference.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/reference/thread_extensions_reference.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,1424 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Thread
+ Extensions Reference</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../reference.html" title=" Reference">
+<link rel="prev" href="concepts.html" title="Concepts">
+<link rel="next" href="thread_array_reference.html" title="Thread
+ Array Reference">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="concepts.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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_array_reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference"></a><a href="thread_extensions_reference.html" title="Thread
+ Extensions Reference">Thread
+ Extensions Reference</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decoration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration">
+ Class <code class="computeroutput"><span class="identifier">thread_decoration</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator">
+ Class <code class="computeroutput"><span class="identifier">thread_decorator</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.decorate">
+ Non Member Function <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr">
+ Template Class <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_keep_alive</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">enable_keep_alive</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">disable_keep_alive</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_check_point">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_check_point</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_enabled">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_enabled</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_set_on_dead_thread">
+ Non Member Function <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp" title="
+ Header &lt;boost/interthreads/thread_decoration.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decoration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration">
+ Class <code class="computeroutput"><span class="identifier">thread_decoration</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+ <span class="keyword">class</span> <span class="identifier">thread_decoration</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration" title="
+ Class thread_decoration">
+ Class <code class="computeroutput"><span class="identifier">thread_decoration</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.thread_decoration_class_constructor_setup">
+ Constructor with setup</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.constructor_with_setup___cleanup">Constructor
+ with setup &amp; cleanup</a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_decoration</span></code> defines
+ a couple of setup/cleanup functions chained to the last constructed decoration,
+ i.e. decorations are chained between them.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">thread_decoration</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable1</span><span class="special">&gt;</span>
+ <span class="identifier">thread_decoration</span><span class="special">(</span><span class="identifier">Callable1</span> <span class="identifier">setup</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable1</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">Callable2</span><span class="special">&gt;</span>
+ <span class="identifier">thread_decoration</span><span class="special">(</span><span class="identifier">Callable1</span> <span class="identifier">setup</span><span class="special">,</span> <span class="identifier">Callable2</span> <span class="identifier">cleanup</span><span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">thread_decoration</span><span class="special">()</span> <span class="special">{</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.thread_decoration_class_constructor_setup"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.thread_decoration_class_constructor_setup" title="
+ Constructor with setup">
+ Constructor with setup</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+<span class="identifier">thread_decoration</span><span class="special">(</span><span class="identifier">Callable</span> <span class="identifier">func</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> is <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>. Copying <code class="computeroutput"><span class="identifier">setup</span></code> shall have no side effects,
+ and the effect of calling the copy shall be equivalent to calling
+ the original.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">setup</span></code> is copied
+ into storage managed internally by the library, and that copy is
+ invoked by the <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code> function.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to a decoration.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ unsafe
+ </p></dd>
+</dl>
+</div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The library do not ensures any order of decorations.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.constructor_with_setup___cleanup"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decoration_hpp.thread_decoration.constructor_with_setup___cleanup" title="Constructor
+ with setup &amp; cleanup">Constructor
+ with setup &amp; cleanup</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable1</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">Callable2</span><span class="special">&gt;</span>
+<span class="identifier">thread_decoration</span><span class="special">(</span><span class="identifier">Callable1</span> <span class="identifier">setup</span><span class="special">,</span> <span class="identifier">Callable2</span> <span class="identifier">cleanup</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable1</span></code> &amp;
+ <code class="computeroutput"><span class="identifier">Callable1</span></code> are
+ <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
+ Copying <code class="computeroutput"><span class="identifier">setup</span></code> or
+ <code class="computeroutput"><span class="identifier">cleanup</span></code> shall have
+ no side effects, and the effect of calling the copy shall be equivalent
+ to calling the original.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">setup</span></code> and <code class="computeroutput"><span class="identifier">cleanup</span></code> are copied into storage
+ managed internally by the library, and the <code class="computeroutput"><span class="identifier">setup</span></code>
+ copy is invoked by the <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code> function. If successful the cleanup
+ function is registered to the to the thread exit handler.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
+ refers to a decoration.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ unsafe
+ </p></dd>
+</dl>
+</div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The library do not ensures any order of setup decorations neither
+ of cleanup decorations.
+ </p></td></tr>
+</table></div>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp" title="
+ Header &lt;boost/interthreads/thread_decorator.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator">
+ Class <code class="computeroutput"><span class="identifier">thread_decorator</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.decorate">
+ Non Member Function <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+ <span class="keyword">class</span> <span class="identifier">thread_decorator</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">decorate</span><span class="special">();</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator" title="
+ Class thread_decorator">
+ Class <code class="computeroutput"><span class="identifier">thread_decorator</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructorn">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_move_constructor">
+ Copy Move Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_constructor">
+ Assign Move Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_conversion">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_move">
+ Member Function <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_swap">
+ Member Function <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_operator_f">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_decorator</span></code> is a
+ functor wrapping a function with the setup and the cleanup of chained
+ decorations which will be called only once by thread: decoration's setup
+ are called before the thread function and decoration's cleanup at thread
+ exit.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">thread_decorator</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+ <span class="keyword">explicit</span> <span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span><span class="special">&amp;&amp;</span> <span class="identifier">f</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+ <span class="keyword">explicit</span> <span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">Callable</span><span class="special">&gt;</span> <span class="identifier">f</span><span class="special">):</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+ <span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span> <span class="identifier">f</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">disable_if</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&amp;,</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;</span> <span class="special">&gt;</span>
+ <span class="special">,</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">*</span> <span class="special">&gt;::</span><span class="identifier">type</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A2</span><span class="special">,</span> <span class="special">...&gt;</span>
+ <span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span> <span class="identifier">f</span><span class="special">,</span> <span class="identifier">A1</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">A2</span> <span class="identifier">a2</span><span class="special">,</span> <span class="special">...)</span>
+
+ <span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+
+ <span class="identifier">thread_decorator</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+
+ <span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">move</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">thread_decorator</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="keyword">operator</span> <span class="special">()();</span>
+
+<span class="special">};</span>
+</pre>
+<p>
+ Functor wrapping the user function thread to ensure that all the decorations
+ are called.
+ </p>
+<p>
+ Objects of type <code class="computeroutput"><span class="identifier">thread_decorator</span></code>
+ are movable, so they can be stored in move-aware containers, and returned
+ from functions. This allows the details of thread decoration to be wrapped
+ in a function.
+ </p>
+<pre class="programlisting"><span class="identifier">thread_decorator</span> <span class="identifier">make_decorator</span><span class="special">();</span>
+
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boot</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">some_thread</span><span class="special">(</span><span class="identifier">make_decorator</span><span class="special">());</span>
+ <span class="identifier">some_thread</span><span class="special">.</span><span class="identifier">join</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ On compilers that support rvalue references, <code class="computeroutput"><span class="identifier">thread_decorator</span></code>
+ will provides a proper move constructor and move-assignment operator,
+ and therefore meets the C++0x <code class="computeroutput"><span class="identifier">MoveConstructible</span></code>
+ and <code class="computeroutput"><span class="identifier">MoveAssignable</span></code>
+ concepts. With such compilers, <code class="computeroutput"><span class="identifier">thread_decorator</span></code>
+ can therefore be used with containers that support those concepts.
+ </p>
+<p>
+ For other compilers, move support is provided with a move emulation
+ layer, so containers must explicitly detect that move emulation layer.
+ See <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">move</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> for details.
+ </p>
+</td></tr>
+</table></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+<span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span><span class="special">&amp;&amp;</span> <span class="identifier">func</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable</span><span class="special">&gt;</span>
+<span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span> <span class="identifier">func</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Template parameters:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> must by
+ <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func</span></code> is copied
+ into storage managed internally by the library, and that copy will
+ be invoked after the operator() function when the decorate is used
+ as Callable of a newly-created thread of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructorn"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_constructorn" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Callable</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A2</span><span class="special">,</span> <span class="special">...&gt;</span>
+<span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">Callable</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">A1</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">A2</span> <span class="identifier">a2</span><span class="special">,</span> <span class="special">...)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Template parameters:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> must by
+ <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func</span></code> is copied
+ into storage managed internally by the library, and that copy will
+ be invoked after the operator() function when the decorate is used
+ as Callable of a newly-created thread of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe
+ </p></dd>
+<dt><span class="term">Limitations:</span></dt>
+<dd><p>
+ The current implementation defines overloads up to four parameters.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_move_constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_move_constructor" title="
+ Copy Move Constructor">
+ Copy Move Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+<span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;</span> <span class="identifier">other</span><span class="special">)</span> <span class="special">{</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Template parameters:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> must by
+ <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func</span></code> is copied
+ into storage managed internally by the library, and that copy will
+ be invoked after the operator() function when the decorate is used
+ as Callable of a newly-created thread of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_decorate_copy_constructor" title="
+ Assign Move Constructor">
+ Assign Move Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">thread_decorator</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+<span class="identifier">thread_decorator</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> must by
+ <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">func</span></code> is copied
+ into storage managed internally by the library, and that copy will
+ be invoked after the operator() function when the decorate is used
+ as Callable of a newly-created thread of execution.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ a reference to <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ neutral
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_conversion"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_conversion" title="
+ Member Function operator detail::thread_move_t&lt;thread_decorator&gt;()">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ helper for move semantics emulation.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ the move form <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ neutral
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_move"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_move" title="
+ Member Function move()">
+ Member Function <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special">&lt;</span><span class="identifier">thread_decorator</span><span class="special">&gt;</span> <span class="identifier">move</span><span class="special">()</span> <span class="special">{</span>
+<span class="identifier">thread_decorator</span><span class="special">&amp;&amp;</span> <span class="identifier">move</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Move *this to the caller.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ the move form <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ neutral
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_swap"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_swap" title="
+ Member Function swap()">
+ Member Function <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">thread_decorator</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ neutral
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_operator_f"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.thread_decorator.decorator_thread_decoration_operator_f" title="
+ Member Function operator()()">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Functor operator
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Any exception thrown by the decorations or the user function.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ unsafe - depends on the decorations construction/destruction.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.decorate"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_decorator_hpp.decorate" title="
+ Non Member Function decorate()">
+ Non Member Function <code class="computeroutput"><span class="identifier">decorate</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">decorate</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">Callable</span></code> is <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>. Copying <code class="computeroutput"><span class="identifier">f</span></code> shall have no side effects, and
+ the effect of calling the copy shall be equivalent to calling the
+ original.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Calls every declared decoration using the thread_decoration class.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ All the decorations have been called.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Any exception thrown by the decorations.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ unsafe - depends on the decorations construction/destruction.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp" title="
+ Header &lt;boost/interthreads/thread_specific_shared_ptr.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr">
+ Template Class <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">;</span>
+
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr" title="
+ Template Class thread_specific_shared_ptr&lt;&gt;">
+ Template Class <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_parameters">
+ Template parameters</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_types">
+ Public types</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_default_constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_constructor_with_custom_cleanup">
+ Cleanup Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_destructor">
+ Destructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_get">
+ Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_arrow">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-&gt;()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_star">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reset">
+ Member Function <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_wait_and_get">
+ Member Function <code class="computeroutput"><span class="identifier">wait_and_get</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operatora">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">[]()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_mutex">
+ Member Function <code class="computeroutput"><span class="identifier">get_mutex</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_map">
+ Member Function <code class="computeroutput"><span class="identifier">get_map</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code>
+ is an extension of the thread_specific_ptr providing access to the thread
+ specific context from other threads.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">thread_specific_shared_ptr</span> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">shared_ptr_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="char">'implementation defined'</span> <span class="identifier">map_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="char">'implementation defined'</span> <span class="identifier">mutex_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="char">'implementation defined'</span> <span class="identifier">lock_type</span><span class="special">;</span>
+
+ <span class="identifier">thread_specific_shared_ptr</span><span class="special">();</span>
+ <span class="keyword">explicit</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">(</span><span class="keyword">void</span> <span class="special">(*</span><span class="identifier">cleanup_</span><span class="special">)(</span><span class="identifier">shared_ptr_type</span><span class="special">));</span>
+ <span class="special">~</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">();</span>
+
+ <span class="identifier">T</span><span class="special">*</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">();</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">A</span> <span class="identifier">a</span><span class="special">);</span>
+
+ <span class="identifier">mutex_type</span><span class="special">&amp;</span> <span class="identifier">get_mutex</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">map_type</span><span class="special">&amp;</span> <span class="identifier">get_map</span><span class="special">(</span><span class="identifier">lock_type</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">shared_ptr_type</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">shared_ptr_type</span> <span class="identifier">wait_and_get</span><span class="special">(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">shared_ptr_type</span> <span class="identifier">get_shared_ptr</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_parameters"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_parameters" title="
+ Template parameters">
+ Template parameters</a>
+</h6></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> is instantiated with the following
+ types:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ T The type of the pointeed object
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_types"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reference_types" title="
+ Public types">
+ Public types</a>
+</h6></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> defines the following types:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<span class="bold"><strong><code class="computeroutput"><span class="identifier">shared_ptr_type</span></code></strong></span>
+ The shared pointed type.
+ </li>
+<li>
+<span class="bold"><strong><code class="computeroutput"><span class="identifier">map_type</span></code></strong></span>
+ The mapping type from <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code>
+ to <code class="computeroutput"><span class="identifier">shared_ptr_type</span></code>
+</li>
+<li>
+<span class="bold"><strong><code class="computeroutput"><span class="identifier">mutex_type</span></code></strong></span>
+ The protecting mutext type follwing the Lockable Concept
+ </li>
+<li>
+<span class="bold"><strong><code class="computeroutput"><span class="identifier">lock_type</span></code></strong></span>
+ The lock used to get the map follwing the unique_lock subjacent Concept
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_default_constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_default_constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">thread_specific_shared_ptr</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Construct a <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> object for storing a pointer
+ to an object of type <code class="computeroutput"><span class="identifier">T</span></code>
+ specific to each thread.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_constructor_with_custom_cleanup"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_constructor_with_custom_cleanup" title="
+ Cleanup Constructor">
+ Cleanup Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">(</span><span class="keyword">void</span> <span class="special">(*</span><span class="identifier">cleanup_</span><span class="special">)(</span><span class="identifier">shared_ptr_type</span><span class="special">));</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">cleanup_function</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">())</span></code> does not throw any exceptions.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Construct a <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> object for storing a pointer
+ to an object of type <code class="computeroutput"><span class="identifier">T</span></code>
+ specific to each thread. The supplied <code class="computeroutput"><span class="identifier">cleanup_function</span></code>
+ will be called at thread exit.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_destructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Remove from the static map the current thread::id and destroys
+ <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Care needs to be taken to ensure that any threads still running after
+ an instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> has been destroyed do not
+ call any member functions on that instance. Is for this raison that
+ usualy instance of this class are static.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_get"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_get" title="
+ Member Function get()">
+ Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">shared_ptr_type</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ The pointer associated with the current thread.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The initial value associated with an instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> is <code class="computeroutput"><span class="number">0</span></code>
+ for each thread.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_arrow"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_arrow" title="
+ Member Function operator-&gt;()">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-&gt;()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">T</span><span class="special">*</span> <span class="keyword">operator</span><span class="special">-&gt;()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span></code>
+ is not <code class="computeroutput"><span class="number">0</span></code>.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_star"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operator_star" title="
+ Member Function operator*()">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Requires:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span></code>
+ is not <code class="computeroutput"><span class="number">0</span></code>.
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="special">*(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">())</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reset"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_reset" title="
+ Member Function reset()">
+ Member Function <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">reset</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Equivalent to <code class="computeroutput"><span class="identifier">shared_ptr</span><span class="special">().</span><span class="identifier">swap</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get_shared_ptr</span><span class="special">())</span></code>. Update the mapping.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()==</span><span class="number">0</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">new_value</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Equivalent to <code class="computeroutput"><span class="identifier">shared_ptr</span><span class="special">(</span><span class="identifier">new_value</span><span class="special">).</span><span class="identifier">swap</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get_shared_ptr</span><span class="special">())</span></code>. Update the mapping.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()==</span><span class="identifier">new_value</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">new_value</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">deleter</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Equivalent to <code class="computeroutput"><span class="identifier">shared_ptr</span><span class="special">(</span><span class="identifier">new_value</span><span class="special">,</span> <span class="identifier">deleter</span><span class="special">).</span><span class="identifier">swap</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get_shared_ptr</span><span class="special">())</span></code>. Update the mapping.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()==</span><span class="identifier">new_value</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">D</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span><span class="identifier">Y</span> <span class="special">*</span> <span class="identifier">new_value</span><span class="special">,</span> <span class="identifier">D</span> <span class="identifier">deleter</span><span class="special">,</span> <span class="identifier">A</span> <span class="identifier">a</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Equivalent to <code class="computeroutput"><span class="identifier">shared_ptr</span><span class="special">(</span><span class="identifier">new_value</span><span class="special">,</span> <span class="identifier">deleter</span><span class="special">,</span> <span class="identifier">a</span><span class="special">).</span><span class="identifier">swap</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get_shared_ptr</span><span class="special">())</span></code>. Update the mapping.
+ </p></dd>
+<dt><span class="term">Postcondition:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()==</span><span class="identifier">new_value</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> when resources unavailable.
+ </p></dd>
+<dt><span class="term">Thread safety:</span></dt>
+<dd><p>
+ safe.
+ </p></dd>
+</dl>
+</div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ If <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()!=</span><span class="identifier">new_value</span></code> and <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span></code> is non-<code class="computeroutput"><span class="identifier">NULL</span></code>,
+ invoke <code class="computeroutput"><span class="keyword">delete</span> <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span></code> or <code class="computeroutput"><span class="identifier">deleter</span><span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">())</span></code> as appropriate. Store <code class="computeroutput"><span class="identifier">new_value</span></code> as the pointer associated
+ with the current thread.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_wait_and_get"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_wait_and_get" title="
+ Member Function wait_and_get()">
+ Member Function <code class="computeroutput"><span class="identifier">wait_and_get</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">shared_ptr_type</span> <span class="identifier">wait_and_get</span><span class="special">(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until the specific shared pointer has been set and returns
+ a shared pointer to this context.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_interrupted</span></code> if the current
+ thread of execution is interrupted.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operatora"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.thread_specific_shared_ptr_operatora" title="
+ Member Function operator[]()">
+ Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">[]()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">shared_ptr_type</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns a copy of the specific shared_ptr of the thread of execution
+ identified by the <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_mutex"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_mutex" title="
+ Member Function get_mutex()">
+ Member Function <code class="computeroutput"><span class="identifier">get_mutex</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">mutex_type</span><span class="special">&amp;</span> <span class="identifier">get_mutex</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns a reference to the protection mutex.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_map"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.thread_specific_shared_ptr_hpp.thread_specific_shared_ptr_reference_thread_specific_shared_ptr.get_map" title="
+ Member Function get_map()">
+ Member Function <code class="computeroutput"><span class="identifier">get_map</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">map_type</span><span class="special">&amp;</span> <span class="identifier">get_map</span><span class="special">(</span><span class="identifier">lock_type</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns a reference to the mapping from <code class="computeroutput"><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code>
+ to the specific pointers provided the user gives a lock on the
+ motext get using <code class="computeroutput"><span class="identifier">get_mutex</span><span class="special">()</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp" title="
+ Header &lt;boost/interthreads/thread_keep_alive.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_keep_alive</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">enable_keep_alive</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">disable_keep_alive</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_check_point">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_check_point</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_enabled">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_enabled</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_set_on_dead_thread">
+ Non Member Function <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ Includes the keep alive enabling/disabling classes and non member functions.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">this_thread</span> <span class="special">{</span>
+ <span class="keyword">class</span> <span class="identifier">enable_keep_alive</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">disable_keep_alive</span><span class="special">;</span>
+
+ <span class="keyword">void</span> <span class="identifier">keep_alive_check_point</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">keep_alive_enabled</span><span class="special">();</span>
+ <span class="keyword">typedef</span> <span class="keyword">void</span> <span class="special">(*</span><span class="identifier">on_dead_thread_type</span><span class="special">)(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive" title="
+ class enable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">enable_keep_alive</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Destructor">
+ Destructor</a></span></dt>
+</dl></div>
+<p>
+ Keep alive enabler.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">enable_keep_alive</span> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span><span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">enable_keep_alive</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">threshold</span><span class="special">=</span><span class="number">2</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">tap</span><span class="special">=</span><span class="number">1</span><span class="special">);</span>
+ <span class="special">~</span><span class="identifier">enable_keep_alive</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">enable_keep_alive</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">threshold</span><span class="special">=</span><span class="number">2</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">tap</span><span class="special">=</span><span class="number">1</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Enable the keep alive mechanism on this thread of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Destructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.enable_keep_alive.keep_alive_enable_keep_alive_Destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">enable_keep_alive</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Restore the keep alive mechanism as it was before the constructor.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive" title="
+ class disable_keep_alive">
+ class <code class="computeroutput"><span class="identifier">disable_keep_alive</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Destructor">
+ Destructor</a></span></dt>
+</dl></div>
+<p>
+ Keep alive disabler.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">disable_keep_alive</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">disable_keep_alive</span><span class="special">();</span>
+ <span class="special">~</span><span class="identifier">disable_keep_alive</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Constructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Constructor" title="
+ Constructor">
+ Constructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">disable_keep_alive</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Disable the keep alive mechanism on this thread of execution.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Destructor"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_disable_keep_alive.keep_alive_disable_keep_alive_Destructor" title="
+ Destructor">
+ Destructor</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">disable_keep_alive</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Restore the keep alive mechanism as it was before the constructor.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_check_point"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_check_point" title="
+ Non Member Function keep_alive_check_point()">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_check_point</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<p>
+ Keep alive check point.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">keep_alive_check_point</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ States that the current thread is alive.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ The thread is alive.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_enabled"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_enabled" title="
+ Non Member Function keep_alive_enabled()">
+ Non Member Function <code class="computeroutput"><span class="identifier">keep_alive_enabled</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<p>
+ Keep alive query.
+ </p>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">keep_alive_enabled</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ States if the keep alive mechanism is enabled on this thread.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_set_on_dead_thread"></a><a href="thread_extensions_reference.html#toward_boost_interthreads.reference.thread_extensions_reference.keep_alive_file_hpp.keep_alive_keep_alive_set_on_dead_thread" title="
+ Non Member Function set_on_dead_thread()">
+ Non Member Function <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<p>
+ Keep alive on dead thread action setting.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Modifies the action to be done when a this thread is declared dead.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="concepts.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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_array_reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,67 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Users'Guide</title>
+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../index.html" title="Toward Boost.InterThreads">
+<link rel="prev" href="overview/motivation.html" title=" Motivation">
+<link rel="next" href="users_guide/getting_started.html" title="
+ Getting Started">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="overview/motivation.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="toward_boost_interthreads.users_guide"></a> Users'Guide
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="users_guide/getting_started.html">
+ Getting Started</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="users_guide/getting_started.html#toward_boost_interthreads.users_guide.getting_started.install">
+ Installing InterThreads</a></span></dt>
+<dt><span class="section"><a href="users_guide/getting_started.html#toward_boost_interthreads.users_guide.getting_started.hello_world__decorator">Hello
+ World! decorator</a></span></dt>
+<dt><span class="section"><a href="users_guide/getting_started.html#toward_boost_interthreads.users_guide.getting_started.monotonic_thread_id">Monotonic
+ Thread Id</a></span></dt>
+<dt><span class="section"><a href="users_guide/getting_started.html#toward_boost_interthreads.users_guide.getting_started.basic_keep_alive">Basic
+ keep alive</a></span></dt>
+</dl></dd>
+<dt><span class="section"> Tutorial</span></dt>
+<dd><dl><dt><span class="section"><a href="users_guide/tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions">Thread
+ Extensions</a></span></dt></dl></dd>
+<dt><span class="section"><a href="users_guide/bibliography.html">
+ References</a></span></dt>
+<dt><span class="section"> Glossary</span></dt>
+</dl></div>
+<p>
+ [/
+ </p>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="overview/motivation.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/bibliography.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/bibliography.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>
+ References</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../users_guide.html" title=" Users'Guide">
+<link rel="prev" href="tutorial.html" title=" Tutorial">
+<link rel="next" href="glosary.html" title=" Glossary">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="glosary.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.users_guide.bibliography"></a><a href="bibliography.html" title="
+ References">
+ References</a>
+</h3></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term"><a href="http://www.boost.org/libs/thread" target="_top">Boost.Thread
+ (A. Williams)</a></span></dt>
+<dd><p>
+ </p></dd>
+</dl>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="glosary.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/getting_started.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/getting_started.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,389 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>
+ Getting Started</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../users_guide.html" title=" Users'Guide">
+<link rel="prev" href="../users_guide.html" title=" Users'Guide">
+<link rel="next" href="tutorial.html" title=" Tutorial">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../users_guide.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="tutorial.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.users_guide.getting_started"></a><a href="getting_started.html" title="
+ Getting Started">
+ Getting Started</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install">
+ Installing InterThreads</a></span></dt>
+<dt><span class="section"><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.hello_world__decorator">Hello
+ World! decorator</a></span></dt>
+<dt><span class="section"><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.monotonic_thread_id">Monotonic
+ Thread Id</a></span></dt>
+<dt><span class="section"><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.basic_keep_alive">Basic
+ keep alive</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.users_guide.getting_started.install"></a><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install" title="
+ Installing InterThreads">
+ Installing InterThreads</a>
+</h4></div></div></div>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.getting_boost_interthreads"></a><h5>
+<a name="id4759283"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.getting_boost_interthreads">Getting
+ Boost.InterThreads</a>
+ </h5>
+<p>
+ You can get the last stable release of <span class="bold"><strong>Boost.InterThreads</strong></span>
+ by downloading <code class="literal">interthreads.zip</code> from the <a href="http://www.boost-consulting.com/vault/index.php?directory=Concurrent%20Programming" target="_top">Boost
+ Vault</a>
+ </p>
+<p>
+ You can also access the latest (unstable?) state from the <a href="https://svn.boost.org/svn/boost/sandbox/interthreads" target="_top">Boost
+ Sandbox</a>.
+ </p>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.building_boost_interthreads"></a><h5>
+<a name="id4759339"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.building_boost_interthreads">Building
+ Boost.InterThreads</a>
+ </h5>
+<p>
+ <span class="bold"><strong>Boost.InterThreads</strong></span> is not a header only
+ library. You need to compile it before use.
+ </p>
+<pre class="programlisting"><span class="identifier">cd</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">build</span>
+<span class="identifier">bjam</span>
+</pre>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.build_requirements"></a><h5>
+<a name="id4759412"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.build_requirements">Build
+ Requirements</a>
+ </h5>
+<p>
+ <span class="bold"><strong>Boost.InterThreads</strong></span> depends on Boost. You
+ must use either Boost version 1.38.x or the version in SVN trunk. In particular,
+ <span class="bold"><strong>Boost.InterThreads</strong></span> depends on:
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Boost.Array</span></dt>
+<dd><p>
+ for array, ...
+ </p></dd>
+<dt><span class="term">Boost.Bind</span></dt>
+<dd><p>
+ for bind, ...
+ </p></dd>
+<dt><span class="term">Boost.Config</span></dt>
+<dd><p>
+ for ??? and abi_prefic_sufix, ...
+ </p></dd>
+<dt><span class="term">Boost.Function</span></dt>
+<dd><p>
+ for function, ...
+ </p></dd>
+<dt><span class="term">Boost.Fusion</span></dt>
+<dd><p>
+ for tuples, and sequence algorithms ...
+ </p></dd>
+<dt><span class="term">Boost.MPL</span></dt>
+<dd><p>
+ for transform, ...
+ </p></dd>
+<dt><span class="term">Boost.Preprocesor</span></dt>
+<dd><p>
+ to simulate variadic templates , ...
+ </p></dd>
+<dt><span class="term">Boost.SmartPtr</span></dt>
+<dd><p>
+ for shared_ptr, ...
+ </p></dd>
+<dt><span class="term">Boost.Threads</span></dt>
+<dd><p>
+ for thread, thread_specific_ptr, call_once, mutex, condition_variable,
+ ...
+ </p></dd>
+<dt><span class="term">Boost.TypeOf</span></dt>
+<dd><p>
+ to register the ACT types.
+ </p></dd>
+<dt><span class="term">Boost.TypeTrais</span></dt>
+<dd><p>
+ for is_void, remove_references, ...
+ </p></dd>
+<dt><span class="term">Boost.Utility</span></dt>
+<dd><p>
+ for result_of, enable_if...
+ </p></dd>
+</dl>
+</div>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.exceptions_safety"></a><h5>
+<a name="id4759694"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.exceptions_safety">Exceptions
+ safety</a>
+ </h5>
+<p>
+ All functions in the library are exception-neutral and provide strong guarantee
+ of exception safety as long as the underlying parameters provide it.
+ </p>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.thread_safety"></a><h5>
+<a name="id4759722"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.thread_safety">Thread
+ safety</a>
+ </h5>
+<p>
+ All functions in the library are thread-unsafe except when noted explicitly.
+ </p>
+<a name="toward_boost_interthreads.users_guide.getting_started.install.tested_compilers"></a><h5>
+<a name="id4759749"></a>
+ <a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.install.tested_compilers">Tested
+ compilers</a>
+ </h5>
+<p>
+ Currently, <span class="bold"><strong>Boost.InterThreads</strong></span> has been
+ tested in the following compilers/platforms:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ GCC 3.4.4 Cygwin
+ </li>
+<li>
+ GCC 3.4.6 Linux
+ </li>
+<li>
+ GCC 4.1.2 Linux
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Please send any questions, comments and bug reports to boost &lt;at&gt;
+ lists &lt;dot&gt; boost &lt;dot&gt; org.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.users_guide.getting_started.hello_world__decorator"></a><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.hello_world__decorator" title="Hello
+ World! decorator">Hello
+ World! decorator</a>
+</h4></div></div></div>
+<p>
+ This is a little bit more than a Hello World! example. It will also say
+ Bye, Bye!
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">bith</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">;</span>
+
+<span class="keyword">void</span> <span class="identifier">my_setup</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Hello World!"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">my_cleanup</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Bye, Bye!"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">my_decoration</span><span class="special">(</span><span class="identifier">my_setup</span><span class="special">,</span> <span class="identifier">my_cleanup</span><span class="special">);</span>
+
+<span class="keyword">void</span> <span class="identifier">my_thread</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"..."</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">(</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_decorator</span><span class="special">(</span><span class="identifier">my_thread</span><span class="special">));</span>
+ <span class="identifier">th</span><span class="special">.</span><span class="identifier">join</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ When <code class="computeroutput"><span class="identifier">th</span></code> is created with
+ the <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decorator</span></code> wrapper, it will initialize
+ all the decorations before calling <code class="computeroutput"><span class="identifier">my_thread</span></code>.
+ This <code class="computeroutput"><span class="identifier">my_cleanup</span></code> will be
+ registered with the <code class="computeroutput"><span class="identifier">boost</span><span class="special">:</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">at_thread_exit</span></code>
+ if the <code class="computeroutput"><span class="identifier">my_setup</span></code> function
+ succeeds i.e. does not throw. Then the thread function <code class="computeroutput"><span class="identifier">my_thread</span></code>
+ is called. At the thread exit, the <code class="computeroutput"><span class="identifier">my_cleanup</span></code>
+ function is called. This results on the following output
+ </p>
+<pre class="programlisting">Hello World!
+...
+Bye, Bye!
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.users_guide.getting_started.monotonic_thread_id"></a><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.monotonic_thread_id" title="Monotonic
+ Thread Id">Monotonic
+ Thread Id</a>
+</h4></div></div></div>
+<p>
+ This example use thread decorator and thread specific pointers to implement
+ a monotonic thread identifier.
+ </p>
+<p>
+ The monotonic thread identifier is managed by the mono_thread_id class.
+ There is a mutex protecting the access to the monotonic counter. The main
+ difference between a thread_specific_shared_ptr and a thread_specific_ptr
+ is that we can get the specific pointer of another thread (*) With the
+ help of bith::thread_decoration, the setting of the thread specific shared
+ pointer is done transparently, as far as the thread is created using a
+ thread decorator. This setup function resets the specific pointer with
+ the value of the monotonic counter which will be self increased.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">bith</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">;</span>
+
+<span class="keyword">class</span> <span class="identifier">mono_thread_id</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">decoration_</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="keyword">unsigned</span><span class="special">&gt;</span> <span class="identifier">tssp_type</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">tssp_type</span> <span class="identifier">current_</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">counter_</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span> <span class="identifier">sync_</span><span class="special">;</span>
+
+ <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">create</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">&gt;</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">sync_</span><span class="special">);</span>
+ <span class="keyword">unsigned</span> <span class="identifier">res</span> <span class="special">=</span> <span class="identifier">counter_</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">counter</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">res</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">setup</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">current_</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="keyword">new</span> <span class="keyword">unsigned</span><span class="special">(</span><span class="identifier">create</span><span class="special">());</span>
+ <span class="special">}</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">id</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="identifier">current_</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">id</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">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="identifier">current_</span><span class="special">[</span><span class="identifier">id</span><span class="special">];</span> <span class="comment">// (*)
+</span> <span class="special">}</span>
+
+<span class="special">};</span>
+
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">decoration</span><span class="special">(</span><span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">setup</span><span class="special">);</span>
+<span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">tssp_type</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">current_</span><span class="special">;</span>
+<span class="keyword">unsigned</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">counter_</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">sync_</span><span class="special">;</span>
+</pre>
+<p>
+ In this way the applications using the thread_decorator can have access
+ to a monotonic thread id mono_thread_id::id() and this id is accesible
+ to other threads providing the boost::thread::id.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">my_thread</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"mono_thread_id="</span> <span class="special">&lt;&lt;</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">id</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">sleep</span><span class="special">(</span><span class="number">5</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">struct</span> <span class="identifier">mono_thread_id_out</span> <span class="special">{</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"thread::id="</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span>
+ <span class="special">&lt;&lt;</span> <span class="string">" mono_thread_id="</span> <span class="special">&lt;&lt;</span> <span class="identifier">mono_thread_id</span><span class="special">::</span><span class="identifier">id</span><span class="special">(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">())</span>
+ <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">shared_threader_decorator</span> <span class="identifier">ae</span><span class="special">;</span>
+ <span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">handles</span><span class="special">,</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">fork_all</span><span class="special">(</span><span class="identifier">basic_threader_decorator</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">));</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">handles</span><span class="special">,</span> <span class="identifier">mono_thread_id_out</span><span class="special">());</span>
+ <span class="identifier">bith</span><span class="special">.</span><span class="identifier">join_all</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ This results on the following output
+ </p>
+<pre class="programlisting">mono_thread_id=1
+mono_thread_id=2
+thread::id=xxxx mono_thread_id=1
+thread::id=xxxx mono_thread_id=2
+
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.users_guide.getting_started.basic_keep_alive"></a><a href="getting_started.html#toward_boost_interthreads.users_guide.getting_started.basic_keep_alive" title="Basic
+ keep alive">Basic
+ keep alive</a>
+</h4></div></div></div>
+<p>
+ This example shows the keep_alive basics.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">thread_decorator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interthreads</span><span class="special">/</span><span class="identifier">keep_alive</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">/</span><span class="identifier">thread</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">bith</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">;</span>
+
+<span class="keyword">void</span> <span class="identifier">my_thread</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">enable_keep_alive</span> <span class="identifier">enabler</span><span class="special">;</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="number">5</span><span class="special">;</span> <span class="identifier">i</span><span class="special">++)</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">keep_alive_point</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"thread_id="</span> <span class="special">&lt;&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">sleep</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">shared_threader_decorator</span> <span class="identifier">ae</span><span class="special">;</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">wait_for_all</span><span class="special">(</span><span class="identifier">ae</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">,</span> <span class="identifier">my_thread</span><span class="special">);</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The user creates 4 threads using the shared_threader_decorator <code class="computeroutput"><span class="identifier">AsynchronousExecutor</span></code> to be able to use
+ the keep_alive mechanism. It uses the default enabler (one keep_alive_point
+ every 2 seconds).
+ </p>
+<p>
+ This results on the following output
+ </p>
+<pre class="programlisting"></pre>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../users_guide.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="tutorial.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/glosary.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/glosary.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,91 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Glossary</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../users_guide.html" title=" Users'Guide">
+<link rel="prev" href="bibliography.html" title="
+ References">
+<link rel="next" href="../reference.html" title=" Reference">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bibliography.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="../reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.users_guide.glosary"></a> Glossary
+</h3></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">alive (thread)</span></dt>
+<dd><p>
+ a thread is considered alive when not dead.
+ </p></dd>
+<dt><span class="term">cleanup decoration</span></dt>
+<dd><p>
+ function called at thread exit.
+ </p></dd>
+<dt><span class="term">dead (thread)</span></dt>
+<dd><p>
+ a thread is considered dead when has not done enough keep alive check
+ points for a given duration.
+ </p></dd>
+<dt><span class="term">decoration</span></dt>
+<dd><p>
+ Couple of setup/cleanup thread decorating functions.
+ </p></dd>
+<dt><span class="term">decorator</span></dt>
+<dd><p>
+ Functor wrapper decorating a thread with all the setups and cleanups
+ decorations.
+ </p></dd>
+<dt><span class="term">deleter TSSS</span></dt>
+<dd><p>
+ specific function used to delete the TSSS.
+ </p></dd>
+<dt><span class="term">KA</span></dt>
+<dd><p>
+ Keep Alive.
+ </p></dd>
+<dt><span class="term">setup decoration</span></dt>
+<dd><p>
+ function called before the thread starts.
+ </p></dd>
+<dt><span class="term">TSS</span></dt>
+<dd><p>
+ Thread Specific Storage.
+ </p></dd>
+<dt><span class="term">TSSS</span></dt>
+<dd><p>
+ Thread Specific Shared Storage.
+ </p></dd>
+</dl>
+</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">Copyright © 2008 -2009 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bibliography.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="../reference.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/tutorial.html
==============================================================================
--- (empty file)
+++ sandbox/interthreads/libs/interthreads/doc/html/toward_boost_interthreads/users_guide/tutorial.html 2009-10-12 17:42:26 EDT (Mon, 12 Oct 2009)
@@ -0,0 +1,1019 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Tutorial</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Toward Boost.InterThreads">
+<link rel="up" href="../users_guide.html" title=" Users'Guide">
+<link rel="prev" href="getting_started.html" title="
+ Getting Started">
+<link rel="next" href="bibliography.html" title="
+ References">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="getting_started.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="bibliography.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial"></a> Tutorial
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions">Thread
+ Extensions</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer">Thread
+ Specific Shared Pointer</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive">Keep
+ alive</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions" title="Thread
+ Extensions">Thread
+ Extensions</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator">Thread
+ Decorator</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer">Thread
+ Specific Shared Pointer</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive">Keep
+ alive</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple">Thread
+ Tuple</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator" title="Thread
+ Decorator">Thread
+ Decorator</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.declaring_a_decoration">Declaring
+ a decoration</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.creating_threads_with_decorators">Creating
+ threads with decorators</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.decorator_explicit_call">
+ Calling explictly the decoration on a thread</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.declaring_a_decoration"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.declaring_a_decoration" title="Declaring
+ a decoration">Declaring
+ a decoration</a>
+</h6></div></div></div>
+<p>
+ Objects of type <code class="computeroutput"><span class="identifier">thread_decoration</span></code>
+ are usualy static and initialized with a <code class="computeroutput"><span class="identifier">Callable</span></code>
+ object:
+ </p>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">interthreads</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">d</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">setup</span><span class="special">();</span>
+
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">d</span><span class="special">(</span><span class="identifier">setup</span><span class="special">);</span>
+</pre>
+<p>
+ These decorations will be called either when we request this explicitly
+ at the initialization of the thread (this is needed on the main thread)
+ or when we create a thread using specific decorator wrapper. This is
+ explained in more detail in the next sections.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.creating_threads_with_decorators"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.creating_threads_with_decorators" title="Creating
+ threads with decorators">Creating
+ threads with decorators</a>
+</h6></div></div></div>
+<p>
+ When we want the decorations to decorate one thread of execution we
+ can create the thread using the decorator wrapper.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">(</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decorator</span><span class="special">(</span><span class="identifier">fct</span><span class="special">));</span>
+</pre>
+<p>
+ or using one of the <code class="computeroutput"><span class="identifier">AsynchronousExecutor</span></code>
+ decorators, as
+ </p>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">basic_threader_decorator</span> <span class="identifier">ae</span><span class="special">;</span>
+<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">th</span><span class="special">,</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">fork</span><span class="special">(</span><span class="identifier">ae</span><span class="special">,</span> <span class="identifier">fct</span><span class="special">));</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.decorator_explicit_call"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_decorator.decorator_explicit_call" title="
+ Calling explictly the decoration on a thread">
+ Calling explictly the decoration on a thread</a>
+</h6></div></div></div>
+<p>
+ For threads that are not created using the boost::thread class, as
+ it is the case of the main thread, we need to call explicitly the function
+ <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span></code> at the begining of the thread.
+ </p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span><span class="special">();</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer" title="Thread
+ Specific Shared Pointer">Thread
+ Specific Shared Pointer</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.key_initialization">Key
+ initialization</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.context_initialization">Context
+ initialization</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_on_the_current_thread">Obtain
+ the pointer to the thread-specific object on the current thread</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_of_another_thread">Obtain
+ the pointer to the thread-specific object of another thread</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.iterating_through_all_the_thread_specific_context">Iterating
+ through all the thread specific context</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.deleting_the_context">Deleting
+ the context</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.cleanup_at_thread_exit">Cleanup
+ at thread exit</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.key_initialization"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.key_initialization" title="Key
+ initialization">Key
+ initialization</a>
+</h6></div></div></div>
+<p>
+ As the curent implementation uses the address of the thread_specific_shared_ptr&lt;&gt;
+ object, there is no need to do anything to get the key.
+ </p>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">ptr</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.context_initialization"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.context_initialization" title="Context
+ initialization">Context
+ initialization</a>
+</h6></div></div></div>
+<p>
+ Initially the pointer has a value of <code class="computeroutput"><span class="number">0</span></code>
+ in each thread, but the value for the current thread can be set using
+ the <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code>
+ member functions.
+ </p>
+<p>
+ If the value of the pointer for the current thread is changed using
+ <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code>,
+ then the previous value is destroyed by calling the deleter routine.
+ Alternatively, the stored value can be reset to <code class="computeroutput"><span class="number">0</span></code>
+ and the prior value returned by calling the <code class="computeroutput"><span class="identifier">release</span><span class="special">()</span></code> member function, allowing the application
+ to take back responsibility for destroying the object.
+ </p>
+<p>
+ Initialization can be done
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ explicitly on the curret thread. Basically it works like a thread
+ local storage from inside the thread.
+ </li></ul></div>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">ptr</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">func</span><span class="special">()</span> <span class="special">{</span> <span class="comment">// current thread
+</span> <span class="comment">// ...
+</span> <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="identifier">p</span><span class="special">);</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ When we associate a thread decoration to the thread_specific_shared_ptr&lt;&gt;
+ we initialize implicitly every thread created with a thread_decorator.
+ </li></ul></div>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">ptr</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">myclass_setup</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">myclass</span><span class="special">(</span><span class="identifier">any</span> <span class="identifier">specific</span> <span class="identifier">parameters</span><span class="special">));</span>
+<span class="special">}</span>
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decoration</span> <span class="identifier">myclass_decoration</span><span class="special">(</span><span class="identifier">myclass_setup</span><span class="special">);</span>
+
+<span class="keyword">void</span> <span class="identifier">func</span><span class="special">()</span> <span class="special">{</span> <span class="comment">// ptr.reset(p); done implicitly
+</span>
+<span class="special">}</span>
+
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">=</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_decorated_thread</span><span class="special">(</span><span class="identifier">func</span><span class="special">);</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_on_the_current_thread"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_on_the_current_thread" title="Obtain
+ the pointer to the thread-specific object on the current thread">Obtain
+ the pointer to the thread-specific object on the current thread</a>
+</h6></div></div></div>
+<p>
+ All functions known from boost::thread_specific_ptr are available except
+ the release function. The value for the current thread can be obtained
+ using the <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>
+ member function, or by using the <code class="computeroutput"><span class="special">*</span></code>
+ and <code class="computeroutput"><span class="special">-&gt;</span></code> pointer deference
+ operators.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">func</span><span class="special">()</span> <span class="special">{</span>
+<span class="special">{</span> <span class="comment">// current thread
+</span> <span class="comment">// ...
+</span> <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ptr</span><span class="special">.</span><span class="identifier">get</span><span class="special">()==</span><span class="number">0</span><span class="special">)</span> <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">myclass</span><span class="special">);</span>
+ <span class="comment">// ...
+</span> <span class="identifier">ptr</span><span class="special">-&gt;</span><span class="identifier">someFct</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_of_another_thread"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.obtain_the_pointer_to_the_thread_specific_object_of_another_thread" title="Obtain
+ the pointer to the thread-specific object of another thread">Obtain
+ the pointer to the thread-specific object of another thread</a>
+</h6></div></div></div>
+<p>
+ Besides, other threads can get access to the data provided a thread::id
+ by:
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">=</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_decorated_thread</span><span class="special">(</span><span class="identifier">func</span><span class="special">);</span>
+
+<span class="identifier">ptr</span><span class="special">[</span><span class="identifier">th</span><span class="special">-&gt;</span><span class="identifier">get_id</span><span class="special">()]-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+</pre>
+<p>
+ where <code class="computeroutput"><span class="identifier">foo</span><span class="special">()</span></code>
+ is a function of <code class="computeroutput"><span class="identifier">myclass</span></code>.
+ </p>
+<p>
+ This could work or not. The issue appears as we can get a reference
+ to a thread before the thread has started, so the setting of the thread
+ specific context could be not yet done. One way to manage with this
+ error is to get the shared pointer and check if it contains something
+ or not.
+ </p>
+<pre class="programlisting"><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">shp</span> <span class="special">=</span> <span class="identifier">ptr</span><span class="special">[</span><span class="identifier">th</span><span class="special">-&gt;</span><span class="identifier">get_id</span><span class="special">()]-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+<span class="keyword">if</span> <span class="special">(</span><span class="identifier">shp</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">!=</span> <span class="number">0</span><span class="special">)</span> <span class="identifier">shp</span><span class="special">-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+<span class="keyword">else</span> <span class="special">...</span>
+</pre>
+<p>
+ When we need this we can pool:
+ </p>
+<pre class="programlisting"><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">shp</span><span class="special">;</span>
+<span class="keyword">do</span> <span class="special">{</span>
+ <span class="identifier">shp</span> <span class="special">=</span> <span class="identifier">ptr</span><span class="special">[</span><span class="identifier">th</span><span class="special">-&gt;</span><span class="identifier">get_id</span><span class="special">()]-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+<span class="special">}</span> <span class="keyword">while</span><span class="special">(</span><span class="identifier">shp</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span>
+<span class="identifier">shp</span><span class="special">-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+</pre>
+<p>
+ The library provides a synchonization mechanism to solve this issue.
+ The wait_and_get() function allows a thread to synchronize with the
+ setting from another thread.
+ </p>
+<pre class="programlisting"><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;</span> <span class="identifier">shp</span> <span class="special">=</span> <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">wait_and_get</span><span class="special">(</span><span class="identifier">th</span><span class="special">-&gt;</span><span class="identifier">get_id</span><span class="special">());</span>
+<span class="identifier">shp</span><span class="special">-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+</pre>
+<p>
+ shared_ptr&lt;myclass&gt; shp = ptr.wait_and_get(th-&gt;get_id());
+ shp-&gt;foo(); or
+ </p>
+<pre class="programlisting"><span class="identifier">ptr</span><span class="special">.</span><span class="identifier">wait_and_get</span><span class="special">(</span><span class="identifier">th</span><span class="special">-&gt;</span><span class="identifier">get_id</span><span class="special">()-&gt;</span><span class="identifier">foo</span><span class="special">();</span>
+</pre>
+<p>
+ In order to ensure that the decorations have been called, a cleaner
+ and safer option is not to return the thread until it has been started.
+ This behavior is obtained each time the thread is created with an
+ <code class="computeroutput"><span class="identifier">AsynchronousExecutor</span></code>
+ decorator, as
+ </p>
+<pre class="programlisting"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">basic_threader_decorator</span> <span class="identifier">ae</span><span class="special">;</span>
+<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">th</span><span class="special">,</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">fork</span><span class="special">(</span><span class="identifier">ae</span><span class="special">,</span> <span class="identifier">func</span><span class="special">));</span>
+<span class="comment">// here you are sure all the decorations have been called
+</span><span class="comment">// so we can access any thread_specific_shared_ptr of the created thread.
+</span></pre>
+<p>
+ The lifetime of the myclass instance is managed by a shared_ptr. One
+ reference is held by the thread (by means of a tss), a second is held
+ by the thread::id to shared_ptr&lt;T&gt; map and additional references
+ might be held by other threads, obtained by <code class="computeroutput"><span class="special">*</span><span class="identifier">pmyclass</span><span class="special">[</span><span class="identifier">th</span><span class="special">]</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.iterating_through_all_the_thread_specific_context"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.iterating_through_all_the_thread_specific_context" title="Iterating
+ through all the thread specific context">Iterating
+ through all the thread specific context</a>
+</h6></div></div></div>
+<p>
+ Another use case appears when some global controller needs to access
+ the thread specific data of all the threads. Several approaches are
+ here possible; the library has choosen to provide a map getter using
+ a external locking mechanism that 'ensure' that the map access is locked
+ during the map query.
+ </p>
+<pre class="programlisting"><span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;::</span><span class="identifier">lock_type</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">ptr</span><span class="special">.</span><span class="identifier">get_mutex</span><span class="special">());</span>
+ <span class="keyword">const</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">myclass</span><span class="special">&gt;::</span><span class="identifier">map_type</span> <span class="identifier">amap</span> <span class="special">=</span> <span class="identifier">ptr</span><span class="special">.</span><span class="identifier">get_map</span><span class="special">(</span><span class="identifier">lock</span><span class="special">);</span>
+ <span class="comment">// use the map
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.deleting_the_context"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.deleting_the_context" title="Deleting
+ the context">Deleting
+ the context</a>
+</h6></div></div></div>
+<p>
+ When a thread exits, the objects associated with each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code>
+ instance is not inmediately destroyed due to its shared nature. It
+ is detached from the current thread and removed from the map. Only
+ when there are no more references to the shared pointer it will be
+ destroyed. By default, the object pointed to by a pointer <code class="computeroutput"><span class="identifier">p</span></code> is destroyed by invoking <code class="computeroutput"><span class="keyword">delete</span> <span class="identifier">p</span></code>,
+ but this can be overridden for a specific instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code>
+ by providing a deleter routine to the constructor. In this case, the
+ object is destroyed by invoking <code class="computeroutput"><span class="identifier">deleter</span><span class="special">(</span><span class="identifier">p</span><span class="special">)</span></code> where <code class="computeroutput"><span class="identifier">deleter</span></code>
+ is the deleter routine supplied to the constructor. The deleter function
+ is called only when there are no more references to the shared pointer.
+ </p>
+<pre class="programlisting"><span class="comment">// Add use of deleter !!!
+</span></pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.cleanup_at_thread_exit"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_specific_shared_pointer.cleanup_at_thread_exit" title="Cleanup
+ at thread exit">Cleanup
+ at thread exit</a>
+</h6></div></div></div>
+<p>
+ When a thread exits, the objects associated with each thread_specific_shared_ptr&lt;&gt;
+ instance is not inmediately destroyed due to its shared nature. Only
+ when there are no more references to the shared pointer it will be
+ destroyed. By default, the object pointed to by a pointer p is destroyed
+ by invoking delete p, but this can be overridden for a specific instance
+ of boost::thread_specific_shared_ptr&lt;&gt; by providing a cleanup
+ routine to the constructor. In this case, the object is destroyed by
+ invoking func(p) where func is the cleanup routine supplied to the
+ constructor. The cleanup functions are called in an unspecified order.
+ If a cleanup routine sets the value of associated with an instance
+ of boost::thread_specific_shared_ptr&lt;&gt; that has already been
+ cleaned up, that value is added to the cleanup list. Cleanup finishes
+ when there are no outstanding instances of boost::thread_specific_shared_ptr&lt;&gt;
+ with values. If a cleanup routine sets the value associated with an
+ instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code>
+ that has already been cleaned up, that value is added to the cleanup
+ list. Cleanup finishes when there are no outstanding instances of
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code>
+ with values.
+ </p>
+<pre class="programlisting"><span class="comment">// Add use of at thread_exit!!!
+</span></pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive" title="Keep
+ alive">Keep
+ alive</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Interface</span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_mechanism_initialization">Keep
+ alive mechanism initialization</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_threads">
+ Which threads can be controlled?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_enabling">
+ Enabling the keep alive mechanism</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_disabling">
+ Disabling the keep alive mechanism</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_persistent">
+ Configuring the dead persistency</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from_the_current_thread">Access
+ from the current thread</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from__the_controller_thread">Access
+ from the controller thread</a></span></dt>
+</dl></div>
+<p>
+ We will use the implementation of the keep alive mechanism as tutorial
+ for the thread decorators, thread specific shared pointers and the keep
+ alive mechanism itself.
+ </p>
+<p>
+ We want to detect situations on which a thread is looping or blocked
+ on some component. The user needs to state when this mechanism is enabled
+ or disabled.
+ </p>
+<p>
+ Since the only purpose is to find threads that don't work, the thread
+ needs to say if it is alive to a controller. The controler requests at
+ predefined intervals if the thread is dead, and in this case it will
+ call a user specific function which by default aborts the program.
+ </p>
+<p>
+ A thread is considered dead if during a given period the number of checkins
+ is inferior to a given threshold. These two parameters are given when
+ the keep alive mechanislm is enabled. At the begining of a thread the
+ keep alive mechanism is disabled.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.interface"></a>Interface
+</h6></div></div></div>
+<p>
+ Next follows the keep alive interface.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">interthreads</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">this_thread</span> <span class="special">{</span>
+ <span class="keyword">class</span> <span class="identifier">enable_keep_alive</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">enable_keep_alive</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">periods</span><span class="special">=</span><span class="number">2</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">checkins</span><span class="special">=</span><span class="number">1</span><span class="special">);</span>
+ <span class="special">~</span><span class="identifier">enable_keep_alive</span><span class="special">();</span>
+ <span class="special">};</span>
+
+ <span class="keyword">class</span> <span class="identifier">disable_keep_alive</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">disable_keep_alive</span><span class="special">();</span>
+ <span class="special">~</span><span class="identifier">disable_keep_alive</span><span class="special">();</span>
+ <span class="special">};</span>
+
+ <span class="keyword">void</span> <span class="identifier">keep_alive_point</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">keep_alive_enabled</span><span class="special">();</span>
+
+ <span class="keyword">typedef</span> <span class="keyword">void</span> <span class="special">(*</span><span class="identifier">on_dead_thread_type</span><span class="special">)(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span><span class="special">,</span> <span class="identifier">thread</span><span class="special">*);</span>
+ <span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">,</span> <span class="identifier">thread</span><span class="special">*</span> <span class="identifier">th</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
+
+ <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">keep_alive_enabled</span><span class="special">(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span><span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span><span class="special">,</span> <span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">,</span> <span class="identifier">thread</span><span class="special">*</span> <span class="identifier">th</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_mechanism_initialization"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_mechanism_initialization" title="Keep
+ alive mechanism initialization">Keep
+ alive mechanism initialization</a>
+</h6></div></div></div>
+<p>
+ There is a single controller <code class="computeroutput"><span class="identifier">keep_alive_mgr</span></code>.
+ The controler needs to access some thread specific shared context
+ <code class="computeroutput"><span class="identifier">thread_keep_alive_ctx</span></code>
+ to be able to control a thread.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">detail</span> <span class="special">{</span>
+ <span class="keyword">struct</span> <span class="identifier">thread_keep_alive_ctx</span> <span class="special">{</span>
+ <span class="comment">// ...
+</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">init</span><span class="special">();</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">&gt;</span> <span class="identifier">tssp</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">tssp</span> <span class="identifier">instance_</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">thread_decoration</span> <span class="identifier">initializer_</span><span class="special">;</span>
+ <span class="identifier">thread_keep_alive_internal</span><span class="special">*</span> <span class="identifier">data_</span><span class="special">;</span>
+ <span class="special">};</span>
+ <span class="keyword">struct</span> <span class="identifier">keep_alive_mgr</span> <span class="special">{</span>
+ <span class="comment">// ...
+</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">initialize</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_once</span><span class="special">(</span><span class="identifier">flag</span><span class="special">,</span> <span class="identifier">init</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">init</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">instance_</span><span class="special">=</span><span class="keyword">new</span> <span class="identifier">keep_alive_mgr</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">thread_</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">once_flag</span> <span class="identifier">flag_</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">keep_alive_mgr</span><span class="special">*</span> <span class="identifier">instance_</span><span class="special">;</span>
+ <span class="special">};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The initialization of the controller itself and the setting the thread
+ specific context is done using an internal thread decoration <code class="computeroutput"><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">initializer_</span></code> with <code class="computeroutput"><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">init</span></code>
+ as setup function.
+ </p>
+<pre class="programlisting"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">&gt;</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance_</span><span class="special">;</span>
+<span class="identifier">thread_decoration</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">initializer_</span><span class="special">(</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">init</span><span class="special">);</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">once_flag</span> <span class="identifier">keep_alive_mgr</span><span class="special">::</span><span class="identifier">flag</span><span class="special">;</span>
+</pre>
+<p>
+ This setup function will initialize the <code class="computeroutput"><span class="identifier">keep_alive_mgr</span></code>
+ and then set the <code class="computeroutput"><span class="identifier">thread_specific_shared_ptr</span><span class="special">&lt;&gt;</span></code> with a new <code class="computeroutput"><span class="identifier">thread_keep_alive_ctx</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">init</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">keep_alive_mgr</span><span class="special">::</span><span class="identifier">initialize</span><span class="special">();</span>
+ <span class="identifier">instance_</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">());</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">keep_alive_mgr</span><span class="special">::</span><span class="identifier">initialize</span></code>
+ function ensures just that the init function is called once using the
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_once</span></code>. This <code class="computeroutput"><span class="identifier">init</span></code>
+ function creates the instance of the <code class="computeroutput"><span class="identifier">keep_alive_mgr</span></code>
+ singleton.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">keep_alive_mgr</span><span class="special">::</span><span class="identifier">initialize</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_once</span><span class="special">(</span><span class="identifier">flag_</span><span class="special">,</span> <span class="identifier">init</span><span class="special">);</span>
+<span class="special">}</span>
+<span class="keyword">void</span> <span class="identifier">keep_alive_mgr</span><span class="special">::</span><span class="identifier">init</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">instance_</span><span class="special">=</span><span class="keyword">new</span> <span class="identifier">keep_alive_mgr</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_threads"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_threads" title="
+ Which threads can be controlled?">
+ Which threads can be controlled?</a>
+</h6></div></div></div>
+<p>
+ As the keep alive mechanism uses a thread decoration, the user needs
+ to explicitly call the <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span></code>
+ function at the begining of the thread function or by wrapping the
+ thread function. Instead of having a specific function to call or use
+ a thread function wrapper, the keep alive uses the functions provided
+ by the thread decorator (<code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span></code>
+ and <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_decorator</span></code>). So we must either
+ call <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span></code> explicitly on the thread
+ function
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fct</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">bith</span><span class="special">::</span><span class="identifier">decorate</span><span class="special">();</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+<p>
+ or create the thread with the <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_decorator</span></code>
+ wrapper
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span> <span class="identifier">th</span><span class="special">(</span><span class="identifier">bith</span><span class="special">::</span><span class="identifier">make_decorator</span><span class="special">(</span><span class="identifier">fct</span><span class="special">));</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_enabling"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_enabling" title="
+ Enabling the keep alive mechanism">
+ Enabling the keep alive mechanism</a>
+</h6></div></div></div>
+<p>
+ To be controled by the keep alive manager we need to enable the mechanism
+ using the enable_keep_alive. By default this enabler requires the application
+ to do at least one check point every 2 seconds using the <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">keep_alive_point</span><span class="special">()</span></code>
+ function.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fct</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">;</span>
+
+ <span class="comment">// ...
+</span> <span class="identifier">enable_keep_alive</span> <span class="identifier">ena</span><span class="special">;</span>
+ <span class="comment">// states that the thread will be declared dead if threre are
+</span> <span class="comment">// less that 1 check_points in 2 seconds.
+</span> <span class="keyword">for</span><span class="special">(;;)</span> <span class="special">{</span>
+ <span class="comment">// do a check point
+</span> <span class="identifier">keep_alive_point</span><span class="special">();</span>
+ <span class="comment">// ...
+</span> <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_disabling"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_disabling" title="
+ Disabling the keep alive mechanism">
+ Disabling the keep alive mechanism</a>
+</h6></div></div></div>
+<p>
+ Some times we need to do an external task that could take an undefined
+ time. We can then disable the keep alive mechanisme by using a disabler
+ <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">disable_keep_alive</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fct</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">;</span>
+
+ <span class="comment">// ...
+</span> <span class="comment">// states that the thread will be declared dead if threre are
+</span> <span class="comment">// less that 1 check_points in 2 seconds.
+</span> <span class="identifier">enable_keep_alive</span> <span class="identifier">enabler</span><span class="special">;</span>
+ <span class="keyword">for</span><span class="special">(;;)</span> <span class="special">{</span>
+ <span class="comment">// do a check point
+</span> <span class="identifier">keep_alive_point</span><span class="special">();</span>
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">cnd</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// when a blocking task spending an undefined time
+</span> <span class="comment">// you can disable the keep alive mechanism
+</span> <span class="identifier">disable_keep_alive</span> <span class="identifier">disabler</span><span class="special">;</span>
+
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ If on the contrary we don't want to disable the keep alive mechanism,
+ it should be interesting to do a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interruption_check_point</span><span class="special">()</span></code> just after the blocking task. In
+ this way if the task takes too much time and the thread is declared
+ dead, the possibility to manage the keep alive error by interrupting
+ the dead thread remains, once the task is finished.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fct</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">;</span>
+
+ <span class="comment">// ...
+</span> <span class="comment">// states that the thread will be declared dead if threre are
+</span> <span class="comment">// less that 1 check_points in 2 seconds.
+</span> <span class="identifier">enable_keep_alive</span> <span class="identifier">enabler</span><span class="special">;</span>
+ <span class="keyword">for</span><span class="special">(;;)</span> <span class="special">{</span>
+ <span class="comment">// do a check point
+</span> <span class="identifier">keep_alive_point</span><span class="special">();</span>
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">cnd</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// when a blocking task spending an undefined time
+</span> <span class="comment">// you can disable the keep alive mechanism
+</span> <span class="identifier">unknow_time_task</span><span class="special">();</span>
+ <span class="identifier">interruption_check_point</span><span class="special">();</span>
+
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_persistent"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.keep_alive_persistent" title="
+ Configuring the dead persistency">
+ Configuring the dead persistency</a>
+</h6></div></div></div>
+<p>
+ The default enabling parameters could be too restrictive in some cases.
+ But the <code class="computeroutput"><span class="identifier">enable_keep_alive</span></code>
+ configures it with the two parameters. We can declare a thread dead
+ when the thread has not done a number of checkins in a given period.
+ This can be useful when one knows the time a given task should take.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fct</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">;</span>
+
+ <span class="comment">// ...
+</span> <span class="comment">// states that the thread will be declared dead if threre are
+</span> <span class="comment">// less that 4 check_points in 30 seconds.
+</span> <span class="identifier">enable_keep_alive</span> <span class="identifier">enabler</span><span class="special">(</span><span class="number">15</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span>
+ <span class="keyword">for</span><span class="special">(;;)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">cnd</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// it is know that this task will take no more than 15 seconds
+</span> <span class="identifier">enable_keep_alive</span> <span class="identifier">control</span><span class="special">(</span><span class="number">15</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span>
+ <span class="identifier">know_time_task</span><span class="special">();</span>
+ <span class="identifier">keep_alive_point</span><span class="special">();</span>
+ <span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruprion_check_point</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="special">}</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from_the_current_thread"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from_the_current_thread" title="Access
+ from the current thread">Access
+ from the current thread</a>
+</h6></div></div></div>
+<p>
+ But how all this works. We start with enablers/disablers. Enablers/disablers
+ use RAII, so they can be nested and the context be restored on the
+ destructor. At the construction they store the current state of the
+ keep alive of this thread using the backup function and then they enable/disable
+ the KA mechanism. On destruction they restore the backed up context.
+ </p>
+<pre class="programlisting"><span class="identifier">enable_keep_alive</span><span class="special">::</span><span class="identifier">enable_keep_alive</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">periods</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">checkins</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">backup_</span><span class="special">=</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">backup</span><span class="special">(</span><span class="identifier">data_</span><span class="special">);</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">enable_keep_alive</span><span class="special">(</span><span class="identifier">periods</span><span class="special">,</span> <span class="identifier">checkins</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="identifier">enable_keep_alive</span><span class="special">::~</span><span class="identifier">enable_keep_alive</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">restore</span><span class="special">(</span><span class="identifier">backup_</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="identifier">disable_keep_alive</span><span class="special">::</span><span class="identifier">disable_keep_alive</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">backup_</span><span class="special">=</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">backup</span><span class="special">(</span><span class="identifier">data_</span><span class="special">);</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">disable_keep_alive</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="identifier">disable_keep_alive</span><span class="special">::~</span><span class="identifier">disable_keep_alive</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">restore</span><span class="special">(</span><span class="identifier">backup_</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ These functions are quite simple
+ </p>
+<pre class="programlisting"><span class="identifier">thread_keep_alive_internal</span><span class="special">*</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">backup</span><span class="special">(</span><span class="identifier">thread_keep_alive_internal</span><span class="special">*</span> <span class="identifier">new_data</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">thread_keep_alive_internal</span><span class="special">*</span> <span class="identifier">the_backup</span><span class="special">=</span><span class="identifier">data_</span><span class="special">;</span>
+ <span class="identifier">data_</span><span class="special">=</span><span class="identifier">new_data</span>
+ <span class="keyword">return</span> <span class="identifier">the_backup</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">restore</span><span class="special">(</span><span class="identifier">thread_keep_alive_internal</span><span class="special">*</span> <span class="identifier">backup</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">data_</span><span class="special">=</span><span class="identifier">backup</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">enable_keep_alive</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">enabled_</span><span class="special">=</span><span class="keyword">true</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="keyword">void</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">disable_keep_alive</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">enabled_</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Note that there is no need to check if the <code class="computeroutput"><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance_</span></code>
+ contains a pointer because we have ensured that at initialization time.
+ </p>
+<p>
+ Next there is the central function <code class="computeroutput"><span class="identifier">keep_alive_point</span><span class="special">()</span></code>. This function does nothing more
+ than relaying the request to the specific context of this thread. This
+ function just increases the number of <code class="computeroutput"><span class="identifier">checkins_</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">keep_alive_point</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">check_point</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">check_point</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">++</span><span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">checkins_</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">set_on_dead_thread</span><span class="special">()</span></code> does the same. This function just
+ stores the on-dead action.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">,</span> <span class="identifier">thread</span><span class="special">*</span> <span class="identifier">th</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">()-&gt;</span><span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">fct</span><span class="special">,</span> <span class="identifier">th</span><span class="special">);</span>
+<span class="special">}</span>
+
+ <span class="keyword">void</span> <span class="identifier">set_on_dead_thread</span><span class="special">(</span><span class="identifier">on_dead_thread_type</span> <span class="identifier">fct</span><span class="special">,</span> <span class="identifier">thread</span><span class="special">*</span> <span class="identifier">th</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">on_dead_</span><span class="special">=</span><span class="identifier">fct</span><span class="special">;</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">thread_ptr_</span><span class="special">=</span><span class="identifier">th</span><span class="special">;</span>
+ <span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from__the_controller_thread"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.keep_alive.access_from__the_controller_thread" title="Access
+ from the controller thread">Access
+ from the controller thread</a>
+</h6></div></div></div>
+<p>
+ Up to now we have seen the use of <code class="computeroutput"><span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span></code>
+ as a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_specific_ptr</span></code>, i.e. it is used
+ from the current thread.
+ </p>
+<p>
+ We will see now how the controler behaves. The single instance of the
+ keep_alive_mgr has been created on the init function.
+ </p>
+<p>
+ The constructor just constructs a thread with the loop function.
+ </p>
+<pre class="programlisting"><span class="identifier">keep_alive_mgr</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">end_</span><span class="special">(</span><span class="keyword">false</span><span class="special">),</span> <span class="identifier">thread_</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">loop</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">end_</span><span class="special">)))</span> <span class="special">{}</span>
+</pre>
+<p>
+ The loop function will iterate, every second, over all the thread_keep_alive_ctx
+ threads specific contexts asking them to control themselves. Note that
+ as the map can be modified when threads are created or finished, we
+ need to protect the iteration externally with a lock on the protecting
+ mutex.
+ </p>
+<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">loop</span><span class="special">(</span><span class="keyword">bool</span><span class="special">&amp;</span> <span class="identifier">end</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">xtime</span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">xtime_get</span><span class="special">(&amp;</span><span class="identifier">t</span><span class="special">,</span><span class="number">1</span><span class="special">);</span>
+ <span class="keyword">while</span><span class="special">(!</span><span class="identifier">end</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">t</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">+=</span> <span class="number">1</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">sleep</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">lock_type</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">().</span><span class="identifier">get_mutex</span><span class="special">());</span>
+ <span class="keyword">const</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">tssp</span><span class="special">::</span><span class="identifier">map_type</span><span class="special">&amp;</span> <span class="identifier">tmap</span><span class="special">(</span>
+ <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">instance</span><span class="special">().</span><span class="identifier">get_map</span><span class="special">());</span>
+ <span class="identifier">thread_keep_alive_ctx</span><span class="special">::</span><span class="identifier">tssp</span><span class="special">::</span><span class="identifier">map_type</span><span class="special">::</span><span class="identifier">const_iterator</span> <span class="identifier">it</span> <span class="special">=</span> <span class="identifier">tmap</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="keyword">for</span> <span class="special">(;</span><span class="identifier">it</span> <span class="special">!=</span> <span class="identifier">tmap</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">++</span><span class="identifier">it</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">it</span><span class="special">-&gt;</span><span class="identifier">second</span><span class="special">.</span><span class="identifier">control</span><span class="special">(</span><span class="identifier">it</span><span class="special">-&gt;</span><span class="identifier">first</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The thread loops until the end variable is true. In order to stop proprely
+ this thread we will use the destructor of singleton instance. This
+ end variable is a reference to a variable stored on the keep_alive_mgr
+ context which has been initialized staticly. So its destrcutor will
+ be called when the program finishes. So it is up to the destructor
+ to set this variable and wait for the thread completion
+ </p>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">keep_alive_mgr</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">end_</span><span class="special">=</span><span class="keyword">true</span><span class="special">;</span>
+ <span class="identifier">thread_</span><span class="special">.</span><span class="identifier">join</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The thread_keep_alive_ctx::control function behaves as follows: if
+ it is enabled, it decreases the number of remaining periods and if
+ the thread is declared dead it executes the on dead action and resets
+ the check-ins and periods.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">control</span><span class="special">(</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">enabled_</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">--</span><span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">periods_</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">dead</span><span class="special">())</span> <span class="special">{</span>
+ <span class="identifier">on_dead</span><span class="special">(</span><span class="identifier">id</span><span class="special">);</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">checkins_</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
+ <span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">periods_</span><span class="special">=</span><span class="identifier">data_</span><span class="special">-&gt;</span><span class="identifier">total_periods</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple" title="Thread
+ Tuple">Thread
+ Tuple</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_launching">
+ Launching thread tuple</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_exceptions">
+ Exceptions in thread functions</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_joining">
+ Joining and detaching</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_interruption">
+ Interruption</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_launching"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_launching" title="
+ Launching thread tuple">
+ Launching thread tuple</a>
+</h6></div></div></div>
+<p>
+ A new thread tuple is launched by passing a collection of objects of
+ some callable type, that can be invoked with no parameters. These objects
+ are then copied into internal storage, and invoked on the newly-created
+ threads of execution. If the objects must not (or cannot) be copied,
+ then <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></code> can be used to pass in a reference
+ to the function object. In this case, the user of <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code> must ensure that the referred-to
+ object outlives the newly-created thread of execution.
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">callable</span>
+<span class="special">{</span>
+ <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()();</span>
+<span class="special">};</span>
+
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">copies_are_safe</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">callable</span> <span class="identifier">x</span><span class="special">;</span>
+ <span class="identifier">callable</span> <span class="identifier">y</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">);</span>
+<span class="special">}</span> <span class="comment">// x and y are destroyed, but the newly-created threads have a copy, so this is OK
+</span>
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">oops</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">callable</span> <span class="identifier">x</span><span class="special">;</span>
+ <span class="identifier">callable</span> <span class="identifier">y</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">x</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">y</span><span class="special">));</span>
+<span class="special">}</span> <span class="comment">// x and y are destroyed, but the newly-created threads still have a reference
+</span> <span class="comment">// this leads to undefined behaviour
+</span></pre>
+<p>
+ If you wish to construct an instance of <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code> with a function or callable
+ object that requires arguments to be supplied, this can NOT be done
+ by passing additional arguments as is the case for threads to the
+ <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code>
+ constructor, and you will need to use bind explicitly.
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">find_the_question</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">the_answer</span><span class="special">);</span>
+
+<span class="identifier">bith</span><span class="special">::</span><span class="identifier">thread_tuple</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;</span> <span class="identifier">deep_thought_2</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">find_the_question</span><span class="special">,</span><span class="number">42</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">find_the_question</span><span class="special">,</span><span class="number">16</span><span class="special">));</span>
+</pre>
+<p>
+ The arguments are <span class="emphasis"><em>copied</em></span> into the internals of
+ Boost.Bind structure: if a reference is required, use <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span></code>, just as for references to callable
+ functions.
+ </p>
+<p>
+ The limit on the number of additional arguments that can be passed
+ are specified by the Boost.Bind.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_exceptions"></a><a href="tutorial.html#toward_boost_interthreads.users_guide.tutorial.thread_extensions.thread_tuple.thread_tuple_exceptions" title="
+ Exceptions in thread functions">
+ Exceptions in thread functions</a>
+</h6></div></div></div>
+<p>
+ If the function or callable object passed to the <code class="computeroutput"><span class="identifier">thread_tuple</span><span class="special">&lt;&gt;</span></code> constructor propagates an exception
+ that is not of type <code class="computeroutput"><span class=&qu