Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53608 - in sandbox/task: boost/task/detail libs/task/doc
From: oliver.kowalke_at_[hidden]
Date: 2009-06-03 17:18:29


Author: olli
Date: 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
New Revision: 53608
URL: http://svn.boost.org/trac/boost/changeset/53608

Log:
* rework of detail/atomic.h

Added:
   sandbox/task/boost/task/detail/atomic_aix.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_gcc.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_gcc_ppc.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_gcc_x86.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_hpux.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_interlocked.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_interprocess.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_solaris.hpp (contents, props changed)
   sandbox/task/boost/task/detail/atomic_sync.hpp (contents, props changed)
   sandbox/task/boost/task/detail/has_sync.hpp (contents, props changed)
Text files modified:
   sandbox/task/boost/task/detail/atomic.hpp | 67 +++++++++++++++++++++------------------
   sandbox/task/boost/task/detail/platform.hpp | 2 -
   sandbox/task/libs/task/doc/new_thread.qbk | 2 +
   sandbox/task/libs/task/doc/overview.qbk | 17 +++++++++
   sandbox/task/libs/task/doc/ref_handle.qbk | 13 +++++++
   5 files changed, 67 insertions(+), 34 deletions(-)

Modified: sandbox/task/boost/task/detail/atomic.hpp
==============================================================================
--- sandbox/task/boost/task/detail/atomic.hpp (original)
+++ sandbox/task/boost/task/detail/atomic.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -7,38 +7,43 @@
 #ifndef BOOST_TASK_DETAIL_ATOMIC_H
 #define BOOST_TASK_DETAIL_ATOMIC_H
 
-#include <boost/assert.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/interprocess/detail/atomic.hpp>
-
-#include <boost/config/abi_prefix.hpp>
-
-namespace boost { namespace task
-{
-namespace detail
-{
-//TODO: use interlocked_exchange on Windows
-// and inline assembler on otherplatforms (XCHG etc.)
-inline
-void atomic_exchange( volatile uint32_t * object, uint32_t desired)
-{ interprocess::detail::atomic_write32( object, desired); }
-
-inline
-unsigned int atomic_fetch_add( volatile uint32_t * object, uint32_t operand)
-{
- BOOST_ASSERT( operand == 1);
- return interprocess::detail::atomic_inc32( object);
-}
-
-inline
-unsigned int atomic_fetch_sub( volatile uint32_t * object, uint32_t operand)
-{
- BOOST_ASSERT( operand == 1);
- return interprocess::detail::atomic_dec32( object);
-}
-} } }
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
 
-#include <boost/config/abi_suffix.hpp>
+#include <boost/config.hpp>
+
+#include <boost/task/detail/has_sync.hpp>
+
+# if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#include <boost/task/detail/atomic_interlocked.hpp>
+
+# elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
+#include <boost/task/detail/atomic_gcc_x86.hpp>
+
+# elif defined( __GNUC__ ) && ( defined(__PPC__) || defined(__ppc__) )
+#include <boost/task/detail/atomic_gcc_ppc.hpp>
+
+# elif defined( BOOST_TASK_HAS_SYNC)
+#include <boost/task/detail/atomic_sync.hpp>
+
+# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
+#include <boost/task/detail/atomic_gcc.hpp>
+
+# elif defined(BOOST_TASK_AIX)
+#include <boost/task/detail/atomic_aix.hpp>
+
+# elif defined(BOOST_TASK_HPUX)
+#include <boost/task/detail/atomic_hpux.hpp>
+
+# elif defined(BOOST_TASK_SOLARIS)
+#include <boost/task/detail/atomic_solaris.hpp>
+
+# else
+#include <boost/task/detail/atomic_interprocess.hpp>
+
+# endif
 
 #endif // BOOST_TASK_DETAIL_ATOMIC_H
 

Added: sandbox/task/boost/task/detail/atomic_aix.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_aix.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,46 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_AIX_H
+#define BOOST_TASK_DETAIL_ATOMIC_AIX_H
+
+extern "C"
+{
+#include <sys/atomic_ops.h>
+}
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ * object = desired; }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::fetch_and_add( object, 1);
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::fetch_and_add( object, -1);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_AIX_H
+

Added: sandbox/task/boost/task/detail/atomic_gcc.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_gcc.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,57 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_GCC_H
+#define BOOST_TASK_DETAIL_ATOMIC_GCC_H
+
+// based on boost/smart_ptr/detail/atomic_count_gcc.hpp
+
+# if __GNUC__ * 100 + __GNUC_MINOR__ >= 402
+#include <ext/atomicity.h>
+# else
+#include <bits/atomicity.h>
+# endif
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+
+#if defined(__GLIBCXX__) // g++ 3.4+
+
+using __gnu_cxx::__atomic_add;
+using __gnu_cxx::__exchange_and_add;
+
+#endif
+
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ * object = desired; }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return __exchange_and_add( ( _Atomic_word volatile *) object, 1) + 1;
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return __exchange_and_add( ( _Atomic_word volatile *) object, -1) - 1;
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_GCC_H
+

Added: sandbox/task/boost/task/detail/atomic_gcc_ppc.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_gcc_ppc.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,80 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_GCC_PPC_H
+#define BOOST_TASK_DETAIL_ATOMIC_GCC_PPC_H
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{
+ uint32_t r;
+
+ __asm__ __volatile__
+ (
+ "0:\n\t"
+ "lwarx %0, 0, %2 \n\t"
+ "stwcx. %1, 0, %2 \n\t"
+ "bne- 1b" :
+ "=r" ( r) :
+ "r" ( desired), "r" ( object)
+ );
+}
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ int object_ = static_cast< int >( object);
+ int operand_ = static_cast< int >( operand);
+ int r, t;
+
+ __asm__ __volatile__
+ (
+ "0:\n\t"
+ "lwarx %0,0,%2\n\t"
+ "add %1,%0,%3\n\t"
+ "stwcx. %1,0,%2\n\t"
+ "bne- 0b"
+ : "=&r" ( r), "=&r" ( t)
+ : "b" ( object_), "r" ( operand_)
+ : "memory", "cc"
+ );
+
+ return ++r;
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ int object_ = static_cast< int >( object);
+ int operand_ = static_cast< int >( -1 * operand);
+ int r;
+
+ __asm__ __volatile__
+ (
+ "0:\n\t"
+ "lwarx %0,0,%2\n\t"
+ "add %1,%0,%3\n\t"
+ "stwcx. %1,0,%2\n\t"
+ "bne- 0b"
+ : "=&r" ( r), "=&r" ( t)
+ : "b" ( object_), "r" ( operand_)
+ : "memory", "cc"
+ );
+
+ return --r;
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_GCC_PPC_H
+

Added: sandbox/task/boost/task/detail/atomic_gcc_x86.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_gcc_x86.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,66 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_GCC_X86_H
+#define BOOST_TASK_DETAIL_ATOMIC_GCC_X86_H
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{
+ __asm__ __volatile__
+ (
+ "xchg %0, %1" :
+ "+r" ( desired), "+m" ( * object)
+ );
+}
+
+inline
+long atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ int operand_ = static_cast< int >( operand);
+ int r;
+
+ __asm__ __volatile__
+ (
+ "lock\n\t"
+ "xadd %1, %0" :
+ "+m"( * object), "=r"( r):
+ "1"( operand_):
+ "memory", "cc"
+ );
+
+ return ++r;
+}
+
+inline
+long atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ int operand_ = static_cast< int >( -1 * operand);
+ int r;
+
+ __asm__ __volatile__
+ (
+ "lock\n\t"
+ "xadd %1, %0":
+ "+m"( * object), "=r"( r ):
+ "1"( operand_):
+ "memory", "cc"
+ );
+
+ return --r;
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_GCC_X86_H
+

Added: sandbox/task/boost/task/detail/atomic_hpux.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_hpux.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,45 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_HPUX_H
+#define BOOST_TASK_DETAIL_ATOMIC_HPUX_H
+
+extern "C"
+{
+#include <atomic.h>
+}
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ * object = desired; }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::atomic_inc( object);
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::atomic_dec( object);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_HPUX_H
+

Added: sandbox/task/boost/task/detail/atomic_interlocked.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_interlocked.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,42 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_INTERLOCKED_H
+#define BOOST_TASK_DETAIL_ATOMIC_INTERLOCKED_H
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/detail/detail/interlocked.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ BOOST_INTERLOCKED_EXCHANGE( object, desired); }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return BOOST_INTERLOCKED_INCREMENT( object);
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return BOOST_INTERLOCKED_DECREMENT( object);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_INTERLOCKED_H
+

Added: sandbox/task/boost/task/detail/atomic_interprocess.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_interprocess.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,42 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_INTERPROCESS_H
+#define BOOST_TASK_DETAIL_ATOMIC_INTERPROCESS_H
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/interprocess/detail/atomic.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( volatile uint32_t * object, uint32_t desired)
+{ interprocess::detail::atomic_write32( object, desired); }
+
+inline
+unsigned int atomic_fetch_add( volatile uint32_t * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return interprocess::detail::atomic_inc32( object);
+}
+
+inline
+unsigned int atomic_fetch_sub( volatile uint32_t * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return interprocess::detail::atomic_dec32( object);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_INTERPROCESS_H
+

Added: sandbox/task/boost/task/detail/atomic_solaris.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_solaris.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,45 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_SOLARIS_H
+#define BOOST_TASK_DETAIL_ATOMIC_SOLARIS_H
+
+extern "C"
+{
+#include <atomic.h>
+}
+
+#include <boost/assert.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ * object = desired; }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::atomic_inc_32_nv( object);
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return ::atomic_dec_32_nv( object);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_SOLARIS_H
+

Added: sandbox/task/boost/task/detail/atomic_sync.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/atomic_sync.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,50 @@
+
+// Copyright Oliver Kowalke 2009.
+// 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)
+
+#ifndef BOOST_TASK_DETAIL_ATOMIC_SYNC_H
+#define BOOST_TASK_DETAIL_ATOMIC_SYNC_H
+
+// based on boost/smart_ptr/detail/atomic_count_gc.hpp
+
+# if defined( __ia64__ ) && defined( __INTEL_COMPILER )
+extern "C"
+{
+#include<ia64intrin.h>
+}
+# endif
+
+#include <boost/assert.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace task
+{
+namespace detail
+{
+inline
+void atomic_exchange( uint32_t volatile * object, uint32_t desired)
+{ * object = desired; }
+
+inline
+uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return __sync_add_and_fetch( object, 1);
+}
+
+inline
+uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
+{
+ BOOST_ASSERT( operand == 1);
+ return __sync_add_and_fetch( object, -1);
+}
+} } }
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_ATOMIC_SYNC_H
+

Added: sandbox/task/boost/task/detail/has_sync.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/has_sync.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -0,0 +1,49 @@
+#ifndef BOOST_TASK_DETAIL_HAS_SYNC_H
+#define BOOST_TASK_DETAIL_HAS_SYNC_H
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// based on boost/smart_ptr/detail/sp_has_sync.hpp
+//
+// Copyright (c) 2008, 2009 Peter Dimov
+//
+// 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)
+//
+// Defines the BOOST_SP_HAS_SYNC macro if the __sync_* intrinsics
+// are available.
+//
+
+#if defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
+
+#define BOOST_TASK_HAS_SYNC
+
+#if defined( __arm__ ) || defined( __armel__ )
+#undef BOOST_TASK_HAS_SYNC
+#endif
+
+#if defined( __hppa ) || defined( __hppa__ )
+#undef BOOST_TASK_HAS_SYNC
+#endif
+
+#if defined( __m68k__ )
+#undef BOOST_TASK_HAS_SYNC
+#endif
+
+#if defined( __sparc__ )
+#undef BOOST_TASK_HAS_SYNC
+#endif
+
+#if defined( __INTEL_COMPILER ) && !defined( __ia64__ )
+#undef BOOST_TASK_HAS_SYNC
+#endif
+
+#endif // __GNUC__ * 100 + __GNUC_MINOR__ >= 401
+
+#endif // BOOST_TASK_DETAIL_HAS_SYNC_H

Modified: sandbox/task/boost/task/detail/platform.hpp
==============================================================================
--- sandbox/task/boost/task/detail/platform.hpp (original)
+++ sandbox/task/boost/task/detail/platform.hpp 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -32,8 +32,6 @@
 # define BOOST_TASK_MACOS
 # elif defined(__IBMCPP__) || defined(_AIX)
 # define BOOST_TASK_AIX
-# elif defined(__QNXNTO__)
-# define BOOST_TASK_QNXNTO
 # endif
 
 #endif // BOOST_TASK_DETAIL_PLATFORM_H

Modified: sandbox/task/libs/task/doc/new_thread.qbk
==============================================================================
--- sandbox/task/libs/task/doc/new_thread.qbk (original)
+++ sandbox/task/libs/task/doc/new_thread.qbk 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -10,6 +10,8 @@
 
 __new_thread__ creates a new __thread__ and executes the task in this thread (asynchronous). The created thread gets joined by
 handle (so [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html N2802] should be addressed).
+The returned __handle__ joins the thread in its destructor (if the last reference gets out of scope) and thus provides one possible
+solution of [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html N2880].
 
 [caution Always store the returned __act__ in a variable because __handle__ joins the thread in its destructor (if the last
 reference gets out of scope). ]

Modified: sandbox/task/libs/task/doc/overview.qbk
==============================================================================
--- sandbox/task/libs/task/doc/overview.qbk (original)
+++ sandbox/task/libs/task/doc/overview.qbk 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -32,6 +32,11 @@
         * __as_sub_task__: executes task in newly created thread or in a pool of __worker_threads__ depending on whether current task is already executed in a pool
         * custom pool: task gets executed by a __worker_thread__ of a custom __thread_pool__
 
+* support of forking and joining sub-tasks
+ * better performance
+ * no deadlock because of inline-execution of sub-tasks
+ * automatically detects if code runs in a __thread_pool__ so the appropriate mechanism for executing the sub-tasks is choosen
+
 
 References
 
@@ -41,6 +46,8 @@
 
 * N2802: A plea to reconsider detach-on-destruction for thread objects [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html] written by Hans-J. Boehm.
 
+* N2880: C++ object lifetime interactions with the threads API [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html] written by Hans-J. Boehm and Lawrence Crowl.
+
 * [@http://herbsutter.wordpress.com 'Sutter’s Mill'] by Herb Sutter
 
 * mailing list of C++ standard committee's Library Working Group
@@ -50,10 +57,18 @@
 In order to use the classes and functions described here, you can either include the specific headers specified by the descriptions of each class or function,
 or include the master library header:
 
+``
     #include <boost/task.hpp>
+``
 
 which includes all the other headers in turn.
 
+Used namespaces are:
+
+``
+ namespace boost::task
+ namespace boost::this_task
+``
 
 [heading Tested Platforms]
 
@@ -62,7 +77,7 @@
 * Debian GNU/Linux 2.6.29.2 (x86_64), GCC 4.3.3
 * Ubuntu GNU/Linux 2.6.28.11 (x86), GCC 4.3.3
 * FreeBSD 7.2 (x86), GCC 4.2.1
-* OpenSolaris 0811 (x86_64), SunCC 5.10
+[/ * OpenSolaris 0811 (x86_64), SunCC 5.10 ]
 * Windows XP Professional (x86), MSVC 9.0
 
 

Modified: sandbox/task/libs/task/doc/ref_handle.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_handle.qbk (original)
+++ sandbox/task/libs/task/doc/ref_handle.qbk 2009-06-03 17:18:27 EDT (Wed, 03 Jun 2009)
@@ -38,6 +38,8 @@
 
                 void wait() const;
 
+ shared_future< R > & get_future();
+
                 void swap( handle< R > & other);
         };
 ``
@@ -175,6 +177,17 @@
 [endsect]
 
 
+[section:get_future Member function `get_future()`]
+
+ shared_future< R > & get_future()
+
+[variablelist
+[[Effects:] [returns a reference to the internal shared_future< R >]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
 [section:swap Member function `swap()`]
 
         void swap( handle< R > & other)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk