<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">

<channel>
	<title>Just Software Solutions Blog</title> 
	<link>http://www.justsoftwaresolutions.co.uk/blog/</link> 
	<description>Software and Website Development</description> 

	<language>en-gb</language> 
	<copyright>Copyright 2007-2010 Just Software Solutions Ltd.</copyright> 

	<managingEditor>Anthony Williams</managingEditor> 

	<webMaster>info@justsoftwaresolutions.co.uk</webMaster><item><title>February 2010 C++ Standards Committee Mailing</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-february-2010.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-february-2010.html</guid><pubDate>Tue, 23 Feb 2010 23:05:03 +0000</pubDate><description><![CDATA[
<p>The <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/#mailing2010-02">February
2010 mailing</a> for the C++ Standards Committee was published
last week. This is the pre-meeting mailing for the March 2010 committee
meeting and contains a <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3035.pdf">new
working draft</a>.</p>

<p>There are 5 concurrency-related papers (of which my name is on one),
which I summarize below:</p>

<h3>Concurrency-related papers</h3>

<dl>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3038.html">N3038:
Managing the lifetime of <code>thread_local</code> variables with
contexts (Revision 2)</a></dt>

<dd><p>This is my paper on creating contexts
    for <code>thread_local</code> variables. The use of such contexts
    allows you to control when variables that are declared
    as <code>thread_local</code> are destroyed. It is a revision of my
    previous
    paper <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2959.html">N2959</a>;
    the primary change is that contexts can now be nested, which
    allows library code to use them without having to know whether or
    not a context is currently active.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3040.html">N3040:
Various threads issues in the library (LWG 1151)</a></dt>

<dd><p>This paper by Hans Boehm seeks to
    address <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3018.html#1151">LWG
    issue 1151</a>. The key issue is to ensure that it is clear which
    operations may constitute a data race if they run concurrently
    without synchronization.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3041.html">N3041:
Futures and Async Cleanup</a></dt>

<dd><p>The adoption of multiple papers affecting futures
    and <a href="http://www.stdthread.co.uk/doc/headers/future/async.html"><code>std::async</code></a>
    at the same C++ committee meeting meant that the wording ended up
    being unclear. Detlef Vollmann kindly volunteered to write a paper
    to resolve these issues, and this is it.</p>

  <p>Unfortunately, I think that some of the wording is still
    unclear. I also dislike Detlef's proposal to force
    the <a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_for.html"><code>wait_for</code></a>
    and <a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_until.html"><code>wait_until</code></a>
    member functions of the future types to throw exceptions if the
    future was created from a call
    to <a href="http://www.stdthread.co.uk/doc/headers/future/async.html"><code>std::async</code></a>
    with a launch policy of <code>std::launch::sync</code>. My
    preferred alternative is to change the return type
    from <code>bool</code> to an enumeration with distinct values for
    if the future is ready, if the wait timed out, or if the future
    holds a deferred function from <code>std::launch::sync</code> that
    has not yet started. This would be similar to the current
    behaviour
    of <a href="http://www.stdthread.co.uk/doc/headers/condition_variable/condition_variable/wait_for.html"><code>std::condition_variable::wait_for</code></a>
    and <a href="http://www.stdthread.co.uk/doc/headers/condition_variable/condition_variable/wait_until.html"><code>std::condition_variable::wait_until</code></a>,
    which return a <code>std::cv_status</code> enumeration
    value.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3042.html">N3042:
    Renaming <code>launch::any</code> and what asyncs really might be</a></dt>

<dd><p>This is another paper from Detlef Vollmann proposing
    renaming <code>std::launch::any</code>
    to <code>std::launch::any_sync</code>. His rationale is that
    future revisions of the C++ standard may wish to add values to
    the <code>std::launch</code> enumeration for additional types of
    async calls that should not be covered
    by <code>std::launch::any</code>. Personally, I think this is a
    non-issue, and should be covered as and when such values are
    added.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3045.html">N3045:
Updates to C++ Memory Model Based on Formalization</a></dt>

<dd><p>Following attempts to create a mathematical formalization of
    the memory model it became clear that some cases were unclear or
    ambiguous or did not guarantee the desired semantics. This paper
    proposes some changes to the wording of the memory model in order
    to ensure that it means what we intended it to mean. </p></dd>

</dl>

<h3>Other Papers</h3>

<p>There's several non-concurrency papers in the mailing as well as
  the standard set (working draft, agenda, issues lists, etc.). The
  most significant of these in my view is
  <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3044.html">N3044</a>
  which proposes compiler-defined move constructors and assignment
  operators. Check
  the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/#mailing2010-02">mailing</a>
  for the full set.</p>

<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/">cplusplus</a> /] <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-february-2010.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/C++" rel="tag">C++</a>,  <a href="http://technorati.com/tag/standards" rel="tag">standards</a>,  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-february-2010.html&amp;title=February%202010%20C%2B%2B%20Standards%20Committee%20Mailing"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-february-2010.html&amp;title=February%202010%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-february-2010.html&amp;title=February%202010%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-february-2010.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>The difference between struct and class in C++</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/struct_and_class.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/struct_and_class.html</guid><pubDate>Sun, 21 Feb 2010 21:38:28 +0000</pubDate><description><![CDATA[<p>I've seen a lot of people asking about the differences
  between the use of the <code>struct</code> and <code>class</code>
  keywords in C++ lately. I don't know whether there's an influx of
  C++ programmers due to the upcoming C++0x standard, or whether I've
  just noticed people asking questions that haven't caught my eye
  before. Whatever the reason, I'm writing this blog entry as
  something I can point to the next time someone asks the
  question.</p>

<h3>Declaring and defining user-defined types</h3>

<p>The primary use of both the <code>struct</code>
  and <code>class</code> keywords is to define a user-defined type. In
  C++, such a user-defined type is termed a "class" regardless of
  which keyword is used in the definition. The choice of keyword is in
  one sense arbitrary, since the same features and facilities are
  available whichever keyword is used &mdash; there is only one
  semantic difference which we shall look at shortly. The following
  two class definitions are thus equivalent in all respects apart from
  the names of the classes:

<pre class="listing">
struct type_a
{
private:
    int data;
public:
    type_a(int data_):
        data(data_)
    {}
    virtual void foo()=0;
    virtual ~type_a()
    {}
};

class type_b
{
private:
    int data;
public:
    type_b(int data_):
        data(data_)
    {}
    virtual void foo()=0;
    virtual ~type_b()
    {}
};
</pre>

<p>As this little example shows, you can have constructors,
  destructors, member functions, private members and even virtual
  member functions in a class declared with the <code>struct</code>
  keyword, just as you can with a class declared using
  the <code>class</code> keyword. Though this example doesn't show it,
  you can also use the <code>struct</code> keyword to declare classes
  with base classes.</p>

<p>You can even forward-declare your class using one keyword and then
  define it with the other, though compilers have been known to
  complain about this usage:

<pre class="listing">
struct foo;
class foo {};

class bar;
struct bar {};
</pre>

<p>So, what of the minor semantic difference then? The change is in
  the <em>default</em> access specifier for members and base
  classes. Though classes defined using either keyword can
  have <code>public</code>, <code>private</code>
  and <code>protected</code> base classes and members, the default
  choice for classes defined using <code>class</code>
  is <code>private</code>, whilst for those defined
  using <code>struct</code> the default is <code>public</code>. This
  is primarily for backwards compatibility with C: the members of a C
  structure can be freely accessed by all code so in order to allow
  existing C code to compile unchanged as C++ the default access
  specifier for members of a class declared with <code>struct</code>
  must be <code>public</code>. On the other hand, private data is a
  key aspect of the encapsulation aspect of object-oriented design, so
  this is the default for those classes declare
  with <code>class</code>.</p>

<p>C doesn't have inheritance, but the default access specifier for
  base classes varies with the keyword used to declare the derived
  class too. It is <code>public</code> for classes declared
  with <code>struct</code> and <code>private</code> for those declared
  with <code>class</code> just the same as for data members. You can
  still override it with an explicit specifier in both cases.</p>

<p>Let's take a quick look at some examples to see how that works:

<pre class="listing">
struct s1
{
    int a; // public
private:
    int b; // private
protected:
    int c; // protected
public:
    int d; // public again
};

class c1
{
    int a; // private
private:
    int b; // still private
protected:
    int c; // protected
public:
    int d; // public
};

struct s2:
    s1, // public
    private c1, // private
    type_b, // public again
    protected foo, // protected
    public bar // public again
{};

class c2:
    s1, // private
    private c1, // still private
    type_b, // private again
    protected foo, // protected
    public bar // public
{};
</pre>

<p>As far as declaring and defining user-defined types in C++, that is
  the only difference; in all other respects, classes declared
  with <code>struct</code> are identical to those declared
  with <code>class</code>.</p>

<h3>C Compatibility</h3>

<p>We touched on this a bit earlier: classes declared with
  the <code>struct</code> keyword can be compiled as C if they don't
  use any features that are C++ specific. Thus the following is both a
  valid C++ class and a valid C structure:

<pre class="listing">
struct c_compatible
{
    int i;
    char c;
    double d;
};
</pre>

<p>It is therefore common to see <code>struct</code> used in header
  files that are shared between C and C++. Since non-virtual member
  functions don't affect the class layout you can even have member
  functions in such a type, provided they are hidden from the C
  compiler with a suitable <code>#ifdef</code>:

<pre class="listing">
struct baz
{
    int i;

#ifdef __cplusplus
    void foo();
#endif;
};
</pre>

<h3>Templates</h3>

<p>There is one place where you can use the <code>class</code> keyword
  but not the <code>struct</code> one, and that is in the declaration
  of a template. Template type parameters must be declared using
  either the <code>class</code> or <code>typename</code>
  keyword; <code>struct</code> is not allowed. The choice
  of <code>class</code> or <code>typename</code> in this case is again
  arbitrary &mdash; the semantics are identical. The choice of keyword
  does not impose any semantic meaning, any type (whether a built in
  type like <code>int</code> or a user-defined type like a class or
  enumeration) can be used when instantiating the template in either
  case.You can of course declare a class template with
  the <code>struct</code> keyword, in which case the default access
  for the members of the template is <code>public</code>.</p>

<pre class="listing">
template&lt;class T&gt; // OK
void f1(T t);

template&lt;typename T&gt; // OK
void f2(T t);

template&lt;struct T&gt; // ERROR, struct not allowed here
void f3(T t);

template&lt;class T&gt;
struct S
{
    T x; // public member
};
</pre>

<h3>That's all folks!</h3>

<p>These are the only concrete distinctions between the uses of
  the <code>struct</code> keyword and the <code>class</code> keyword
  in C++. People also use them for documentation purposes,
  reserving <code>struct</code> for C-compatible classes, or classes
  with no member functions, or classes with no private data, or
  whatever their coding standard says. However, this is just
  documentation and convention rather than an inherent difference: you
  could use <code>struct</code> for all your classes,
  or <code>class</code> for all your classes except those that are
  shared with C.</p>

<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/">cplusplus</a> /] <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/struct_and_class.html">permanent link</a></i><br> <small> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fstruct_and_class.html&amp;title=The%20difference%20between%20struct%20and%20class%20in%20C%2B%2B"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fstruct_and_class.html&amp;title=The%20difference%20between%20struct%20and%20class%20in%20C%2B%2B">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fstruct_and_class.html&amp;title=The%20difference%20between%20struct%20and%20class%20in%20C%2B%2B">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/cplusplus/struct_and_class.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>Multithreading in C++0x part 8: Futures, Promises and Asynchronous Function Calls</title><link>http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html</guid><pubDate>Thu, 11 Feb 2010 09:37:07 +0000</pubDate><description><![CDATA[
<p><em>This is the eighth in a series of blog posts introducing the
new C++0x thread library. See <a href="#series">the end of this
article</a> for a full set of links to the rest of the
series.</em></p>

<p>In this installment we'll take a look at the "futures" mechanism
  from C++0x. Futures are a high level mechanism for passing a value
  between threads, and allow a thread to wait for a result to be
  available without having to manage the locks directly.</p>

<h3>Futures and asynchronous function calls</h3>

<p>The most basic use of a future is to hold the result of
  a call to the new <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code> function for running some code
  asynchronously:

<pre class="listing">
#include &lt;future&gt;
#include &lt;iostream&gt;

int calculate_the_answer_to_LtUaE();
void do_stuff();

int main()
{
    std::future&lt;int&gt; the_answer=std::async(calculate_the_answer_to_LtUaE);
    do_stuff();
    std::cout&lt;&lt;"The answer to life, the universe and everything is "
             &lt;&lt;the_answer.get()&lt;&lt;std::endl;
}
</pre>

<p>The call to <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code> takes care of creating a thread, and
  invoking <code>calculate_the_answer_to_LtUaE</code> on that
  thread. The main thread can then get on with
  calling <code>do_stuff()</code> whilst the immensely time consuming
  process of calculating the ultimate answer is done in the
  background. Finally, the call to the <code>get()</code> member
  function of the <code>std::future&lt;int&gt;</code> object then
  waits for the function to complete and ensures that the necessary
  synchronization is applied to transfer the value over so the main
  thread can print "42".</p>

<h3>Sometimes asynchronous functions aren't really asynchronous</h3>

<p>Though I said that <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code> takes care of creating a
  thread, that's not necessarily true. As well as the function being
  called, <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code> takes a <em>launch policy</em> which
  specifies whether to start a new thread or create a "deferred
  function" which is only run when you wait for it. The default launch
  policy for <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code> is <code>std::launch::any</code>,
  which means that the implementation gets to choose for you. If you
  really want to ensure that your function is run on its own thread
  then you need to specify the <code>std::launch::async</code> policy:

<pre>
  std::future&lt;int&gt; the_answer=std::async(<strong>std::launch::async</strong>,calculate_the_answer_to_LtUaE);
</pre>

<p>Likewise, if you really want the function to be executed in
  the <code>get()</code> call then you can specify
  the <code>std::launch::sync</code> policy:

<pre>
  std::future&lt;int&gt; the_answer=std::async(<strong>std::launch::sync</strong>,calculate_the_answer_to_LtUaE);
</pre>

<p>In most cases it makes sense to let the library choose. That way
  you'll avoid creating too many threads and overloading the machine,
  whilst taking advantage of the available hardware threads. If you
  need fine control, you're probably better off managing your own
  threads.</p>

<h3>Divide and Conquer</h3>

<p><code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  can be used to easily parallelize simple algorithms. For example,
  you can write a parallel version of <code>for_each</code> as
  follows:</p>

<pre class="listing">
template&lt;typename Iterator,typename Func&gt;
void parallel_for_each(Iterator first,Iterator last,Func f)
{
    ptrdiff_t const range_length=last-first;
    if(!range_length)
        return;
    if(range_length==1)
    {
        f(*first);
        return;
    }

    Iterator const mid=first+(range_length/2);

    std::future&lt;void&gt; bgtask=std::async(&amp;parallel_for_each&lt;Iterator,Func&gt;,
                                        first,mid,f);
    try
    {
        parallel_for_each(mid,last,f);
    }
    catch(...)
    {
        bgtask.wait();
        throw;
    }
    bgtask.get();   
}
</pre>

<p>This simple bit of code recursively divides up the range into
  smaller and smaller pieces. Obviously an empty range doesn't require
  anything to happen, and a single-point range just requires
  calling <code>f</code> on the one and only value. For bigger ranges
  then an asynchronous task is spawned to handle the first half, and
  then the second half is handled by a recursive
  call.</p>

<p>The <code>try</code> - <code>catch</code> block just ensures that
  the asynchronous task is finished before we leave the function even
  if an exception in order to avoid the background tasks potentially
  accessing the range after it has been destroyed. Finally,
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/get.html">get()</a></code>
  call waits for the background task, <em>and</em> propagates any
  exception thrown from the background task. That way if an exception
  is thrown during any of the processing then the calling code will
  see an exception. Of course if more than one exception is thrown
  then some will get swallowed, but C++ can only handle one exception
  at a time, so that's the best that can be done without using a
  custom <code>composite_exception</code> class to collect them
  all.</p>

<p>Many algorithms can be readily parallelized this way, though you
  may want to have more than one element as the minimum range in order
  to avoid the overhead of spawning the asynchronous tasks.</p>

<h3>Promises</h3>

<p>An alternative to
  using <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  to spawn the task and return the future is to manage the threads
  yourself and use
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>
  class template to provide the
  future. Promises provide a basic mechanism for transferring values
  between threads:
  each <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>
  object is associated with a
  single <code><a href="http://www.stdthread.co.uk/doc/headers/future/future.html">std::future</a></code>
  object. A thread with access to
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/future.html">std::future</a></code>
  object can use wait for the result to be set, whilst another thread
  that has access to the
  corresponding <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>
  object can
  call <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise/set_value.html">set_value()</a></code>
  to store the value and make the future <em>ready</em>. This works
  well if the thread has more than one task to do, as information can
  be made ready to other threads as it becomes available rather than
  all of them having to wait until the thread doing the work has
  completed. It also allows for situations where multiple threads
  could produce the answer: from the point of view of the waiting
  thread it doesn't matter where the answer came from, just that it is
  there so it makes sense to have a single future to represent that
  availability.</p>

<p>For example, asynchronous I/O could be modelled on a promise/future
  basis: when you submit an I/O request then the async I/O handler
  creates a promise/future pair. The future is returned to the caller,
  which can then wait on the future when it needs the data, and the
  promise is stored alongside the details of the request. When the
  request has been fulfilled then the I/O thread can set the value on
  the promise to pass the value back to the waiting thread before
  moving on to process additional requests. The following code shows a
  sample implementation of this pattern.</p>

<pre class="listing">
class aio
{
    class io_request
    {
        std::streambuf* is;
        unsigned read_count;
        std::promise&lt;std::vector&lt;char&gt; &gt; p;
    public:
        explicit io_request(std::streambuf&amp; is_,unsigned count_):
            is(&amp;is_),read_count(count_)
        {}
    
        io_request(io_request&amp;&amp; other):
            is(other.is),
            read_count(other.read_count),
            p(std::move(other.p))
        {}

        io_request():
            is(0),read_count(0)
        {}

        std::future&lt;std::vector&lt;char&gt; &gt; get_future()
        {
            return p.get_future();
        }

        void process()
        {
            try
            {
                std::vector&lt;char&gt; buffer(read_count);

                unsigned amount_read=0;
                while((amount_read != read_count) &amp;&amp; 
                      (is-&gt;sgetc()!=std::char_traits&lt;char&gt;::eof()))
                {
                    amount_read+=is-&gt;sgetn(&amp;buffer[amount_read],read_count-amount_read);
                }

                buffer.resize(amount_read);
                
                p.set_value(std::move(buffer));
            }
            catch(...)
            {
                p.set_exception(std::current_exception());
            }
        }
    };

    thread_safe_queue&lt;io_request&gt; request_queue;
    std::atomic_bool done;

    void io_thread()
    {
        while(!done)
        {
            io_request req=request_queue.pop();
            req.process();
        }
    }

    std::thread iot;
    
public:
    aio():
        done(false),
        iot(&amp;aio::io_thread,this)
    {}

    std::future&lt;std::vector&lt;char&gt; &gt; queue_read(std::streambuf&amp; is,unsigned count)
    {
        io_request req(is,count);
        std::future&lt;std::vector&lt;char&gt; &gt; f(req.get_future());
        request_queue.push(std::move(req));
        return f;
    }
    
    ~aio()
    {
        done=true;
        request_queue.push(io_request());
        iot.join();
    }
};

void do_stuff()
{}

void process_data(std::vector&lt;char&gt; v)
{
    for(unsigned i=0;i&lt;v.size();++i)
    {
        std::cout&lt;&lt;v[i];
    }
    std::cout&lt;&lt;std::endl;
} 

int main()
{
    aio async_io;

    std::filebuf f;
    f.open("my_file.dat",std::ios::in | std::ios::binary);

    std::future&lt;std::vector&lt;char&gt; &gt; fv=async_io.queue_read(f,1048576);
    
    do_stuff();
    process_data(fv.get());
    
    return 0;
}
</pre>


<h3>Next Time</h3>

<p>The sample code above also demonstrates passing exceptions between
  threads using
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise/set_exception.html">set_exception()</a></code>
  member function
  of <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>. I'll
  go into more detail about exceptions in multithreaded next time.</p>

<p><a href="http://www.justsoftwaresolutions.co.uk/index.rss">Subscribe
to the RSS feed <img class="rss"
src="http://www.justsoftwaresolutions.co.uk/images/feed-icon-14x14.png"
alt="RSS feed"></a>
or <a href="http://www.justsoftwaresolutions.co.uk/#subscribe">email
newsletter</a> for this blog to be sure you don't miss the rest of the
series.</p>

<h3>Try it out</h3>

<p>If you're using Microsoft Visual Studio 2008 or g++ 4.3 or 4.4 on
Ubuntu Linux you can try out the examples from this series using our
<code><a href="http://www.stdthread.co.uk">just::thread</a></code>
implementation of the new C++0x thread library. <strong><a
href="http://www.stdthread.co.uk/order.html">Get your copy
today</a></strong>.</p>

<h3><a name="series">Multithreading in C++0x Series</a></h3>

<p>Here are the posts in this series so far:</p>

<ul>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-1-starting-threads.html">Multithreading
in C++0x Part 1: Starting Threads</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-2-function-objects-and-arguments.html">Multithreading
in C++0x Part 2: Starting Threads with Function Objects and
Arguments</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-3.html">Multithreading
in C++0x Part 3: Starting Threads with Member Functions and Reference
Arguments</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-4-protecting-shared-data.html">Multithreading
in C++0x Part 4: Protecting Shared Data</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-5-flexible-locking.html">Multithreading
in C++0x Part 5: Flexible locking
with <code>std::unique_lock&lt;&gt;</code></a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-6-double-checked-locking.html">Multithreading
in C++0x part 6: Lazy initialization and double-checked locking with
atomics</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-7-locking-multiple-mutexes.html">Multithreading
in C++0x part 7: Locking multiple mutexes without deadlock</a></li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html">Multithreading
in C++0x part 8: Futures, Promises and Asynchronous Function Calls</a></li>

</ul>
<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/threading/">threading</a> /] <a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a>,  <a href="http://technorati.com/tag/multithreading" rel="tag">multithreading</a>,  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/thread" rel="tag">thread</a>,  <a href="http://technorati.com/tag/future" rel="tag">future</a>,  <a href="http://technorati.com/tag/promise" rel="tag">promise</a>,  <a href="http://technorati.com/tag/async" rel="tag">async</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fmultithreading-in-c%2B%2B0x-part-8-futures-and-promises.html&amp;title=Multithreading%20in%20C%2B%2B0x%20part%208%3A%20Futures%2C%20Promises%20and%20Asynchronous%20Function%20Calls"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fmultithreading-in-c%2B%2B0x-part-8-futures-and-promises.html&amp;title=Multithreading%20in%20C%2B%2B0x%20part%208%3A%20Futures%2C%20Promises%20and%20Asynchronous%20Function%20Calls">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fmultithreading-in-c%2B%2B0x-part-8-futures-and-promises.html&amp;title=Multithreading%20in%20C%2B%2B0x%20part%208%3A%20Futures%2C%20Promises%20and%20Asynchronous%20Function%20Calls">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>Definitions of Non-blocking, Lock-free and Wait-free</title><link>http://www.justsoftwaresolutions.co.uk/threading/non_blocking_lock_free_and_wait_free.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/threading/non_blocking_lock_free_and_wait_free.html</guid><pubDate>Mon, 25 Jan 2010 11:50:03 +0000</pubDate><description><![CDATA[
<p>There was a post on comp.programming.threads this morning asking
for a definition of these terms. To write good multithreaded code you
really need to understand what these mean, and how they affect the
behaviour and performance of algorithms with these properties. I
thought it would be therefore be useful to provide some
definitions.</p>

<h3>Definition of <em>Blocking</em></h3>

<p>A function is said to be blocking if it calls an operating system
  function that waits for an event to occur or a time period to
  elapse. Whilst a blocking call is waiting the operating system can
  often remove that thread from the scheduler, so it takes no CPU time
  until the event has occurred or the time has elapsed. Once the
  event has occurred then the thread is placed back in the scheduler
  and can run when allocated a time slice. A thread that is running a
  blocking call is said to be <em>blocked</em>.</p>

<p>Mutex lock functions such
  as <code><a href="http://www.stdthread.co.uk/doc/headers/mutex/mutex/lock.html">std::mutex::lock()</a></code>,
  and <code><a href="http://msdn.microsoft.com/en-us/library/ms682608%28VS.85%29.aspx">EnterCriticalSection()</a></code>
  are blocking, as are wait functions such
  as <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/wait.html">std::future::wait()</a></code>
  and <code><a href="http://www.stdthread.co.uk/doc/headers/condition_variable/condition_variable/wait.html">std::condition_variable::wait()</a></code>. However,
  blocking functions are not limited to synchronization facilities:
  the most common blocking functions are I/O facilities such
  as <code>fread()</code> or <code>WriteFile()</code>. Timing
  facilities such
  as <code><a href="http://msdn.microsoft.com/en-us/library/ms686298%28VS.85%29.aspx">Sleep()</a></code>,
  or <code><a href="http://www.stdthread.co.uk/doc/headers/thread/this_thread/sleep_until.html">std::this_thread::sleep_until()</a></code>
  are also often blocking if the delay period is long enough.</p>

<h3>Definition of <em>Non-blocking</em></h3>

<p><em>Non-blocking</em> functions are just those that
  aren't <em>blocking</em>. <em>Non-blocking</em> data structures are
  those on which all operations are <em>non-blocking</em>. All
  <em>lock-free</em> data structures are inherently non-blocking.</p>

<h3>Defintion of <em>lock-free</em></h3>

<p>A <em>lock-free</em> data structure is one that doesn't use any
  mutex locks. The implication is that multiple threads can access the
  data structure concurrently without race conditions or data
  corruption, even though there are no locks &mdash; people would give
  you funny looks if you suggested that <code>std::list</code> was a
  lock-free data structure, even though it is unlikely that there are
  any locks used in the implementation.</p>

<p>Just because more than one thread can safely access a lock-free
  data structure concurrently doesn't mean that there are no
  restrictions on such accesses. For example, a lock-free queue might
  allow one thread to add values to the back whilst another removes
  them from the front, whereas multiple threads adding new values
  concurrently would potentially corrupt the data structure. The data
  structure description will identify which combinations of operations
  can safely be called concurrently.</p>

<p>Finally, just because a data structure is lock-free it doesn't mean
  that threads don't have to wait for each other. If an operation
  takes more than one step then a thread may be pre-empted by the OS
  part-way through an operation. This may then mean that the data
  structure is now in an inconsistent state, and other threads cannot
  perform any operations on the data structure until the operation is
  complete. These threads must then continually check the state of the
  data structure in what is called a <em>busy-wait</em>
  or <em>spin-wait</em>. Such waits are not <em>blocking</em>, and
  will consume processor time because the operating system is not
  aware of the conditions for the wait, and cannot suspend execution
  of the threads. If you use a lock-free data structure with this
  property then high rates of access from multiple threads can
  seriously cripple the performance: the waiting threads may hinder
  the execution of the one thread that can actually make any
  progress. This is especially apparent if the waiting threads are
  higher priority than the thread being waited for, and is
  why <em>wait-free</em> data structures are so important.</p>

<h3>Definition of <em>wait-free</em></h3>

<p>A <em>wait-free</em> data structure is a <em>lock-free</em> data
  structure with the additional property that every thread accessing
  the data structure can make progress, even if every other thread
  accessing the data structure is suspended part-way through an
  operation.</p>

<p>This property means that high-priority threads accessing the data
  structure never have to wait for low-priority threads to complete
  their operations on the data structure, and every thread will always
  be able to make progress when it is scheduled to run by the OS. For
  real-time or semi-real-time systems this can be an essential
  property, as the indefinite wait-periods of blocking or
  non-wait-free lock-free data structures do not allow their use
  within time-limited operations.</p>

<p>The downside of wait-free data structures is that they are more
  complex than their non-wait-free counterparts. This imposes an
  overhead on each operation, potentially making the average time
  taken to perform an operation considerably longer than the same
  operation on an equivalent non-wait-free data structure.</p>

<h3>Choices</h3>

<p>When choosing a data structure for a given task you need to think
  about the costs and benefits of each of the options.</p>

<p>A lock-based data structure is probably the easiest to use, reason
  about and write, but has the potential for limited concurrency. They
  may also be the fastest in low-load scenarios.</p>

<p>A lock-free (but not wait-free) data structure has the potential to
  allow more concurrent accesses, but with the possibility of
  busy-waits under high loads. Lock-free data structures are
  considerably harder to write, and the additional concurrency can
  make reasoning about the program behaviour harder. They may be
  faster than lock-based data structures, but not necessarily.</p>

<p>Finally, a wait-free data structure has the maximum potential for
  true concurrent access, without the possibility of busy
  waits. However, these are very much harder to write than other
  lock-free data structures, and typically impose an additional
  performance cost on every access.</p>

<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/threading/">threading</a> /] <a href="http://www.justsoftwaresolutions.co.uk/threading/non_blocking_lock_free_and_wait_free.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a>,  <a href="http://technorati.com/tag/threading" rel="tag">threading</a>,  <a href="http://technorati.com/tag/multithreading" rel="tag">multithreading</a>,  <a href="http://technorati.com/tag/lock-free" rel="tag">lock-free</a>,  <a href="http://technorati.com/tag/wait-free" rel="tag">wait-free</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fnon_blocking_lock_free_and_wait_free.html&amp;title=Definitions%20of%20Non-blocking%2C%20Lock-free%20and%20Wait-free"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fnon_blocking_lock_free_and_wait_free.html&amp;title=Definitions%20of%20Non-blocking%2C%20Lock-free%20and%20Wait-free">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fnon_blocking_lock_free_and_wait_free.html&amp;title=Definitions%20of%20Non-blocking%2C%20Lock-free%20and%20Wait-free">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/threading/non_blocking_lock_free_and_wait_free.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>just::thread C++0x Thread Library V1.3 Released</title><link>http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3_released.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3_released.html</guid><pubDate>Wed, 13 Jan 2010 17:07:05 +0000</pubDate><description><![CDATA[
<p>I am pleased to announce that version 1.3 of <a
href="http://www.stdthread.co.uk">just::thread</a>, our <a
href="http://www.stdthread.co.uk">C++0x Thread Library</a> has just
been released.</p>

<p>This release is the first to feature support for the new <code><a
href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
function for starting asynchronous tasks. This provides a higher-level
interface for managing threads than is available with <code><a
href="http://www.stdthread.co.uk/doc/headers/thread/thread.html">std::thread</a></code>,
and allows your code to easily take advantage of the available
hardware concurrency without excessive oversubscription.</p>

<p>This is also the first release to support 64-bit Windows.</p>

<p>The linux port is available for 32-bit and 64-bit Ubuntu linux, and
takes full advantage of the C++0x support available from g++ 4.3 and
g++ 4.4. The Windows port is available for Microsoft Visual Studio
2008 for both 32-bit and 64-bit Windows. <strong><a
href="http://www.stdthread.co.uk/order.html">Purchase your copy</a>
and get started NOW.</strong></p>

<p>As usual, existing customers are entitled to a free upgrade to V1.3
from all earlier versions.</p>

<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/news/">news</a> /] <a href="http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3_released.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/multithreading" rel="tag">multithreading</a>,  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a>,  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fjust_thread_c%2B%2B0x_thread_library_v1.3_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3%20Released"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fjust_thread_c%2B%2B0x_thread_library_v1.3_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3%20Released">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fjust_thread_c%2B%2B0x_thread_library_v1.3_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3%20Released">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3_released.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>Happy New Year 2010</title><link>http://www.justsoftwaresolutions.co.uk/news/happy-new-year-2010.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/happy-new-year-2010.html</guid><pubDate>Tue, 05 Jan 2010 09:11:23 +0000</pubDate><description><![CDATA[
<p>It's already five days into 2010, but I'd like to wish you all a
Happy New Year!</p>

<p>2009 was a good year for me. Back in January 2009, my
  <a href="http://www.stdthread.co.uk">implementation of the C++0x
    thread library</a> went on sale, and sales have been growing
    steadily since &mdash; there's a new version due out any day now,
    with support for the new <code>std::async</code> functions and
    64-bit Windows. I
    also <a href="http://www.justsoftwaresolutions.co.uk/news/designing-multithreaded-applications-with-c++0x-accu-2009-slides.html">presented
    at the ACCU conference</a> for the second year running and
    completed the first draft
    of <a href="http://www.stdthread.co.uk/book">my book</a>.</p>

<p>It's also been a big year for the C++ community. The biggest change
  is of course
  that <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-august-2009.html">"Concepts"
  were taken out of the C++0x draft</a> since they were not ready. On
  the concurrency front,
  the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2996.htm">proposal
  for the new <code>std::async</code> functions</a>
  was <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-november-2009.html">accepted</a>,
  <code>std::unique_future</code> was renamed to
  just <code>std::future</code> and the destructor
  of <code>std::thread</code> was changed to
  call <code>std::terminate</code> rather than <code>detach</code> if
  the thread has not been joined or detached.</p>

<h3>Popular articles</h3>

<p>As is my custom, here's a list of the 10 most popular articles and
  blog entries from the Just Software Solutions website in 2009. The
  key difference
  from <a href="http://www.justsoftwaresolutions.co.uk/news/most-popular-articles-of-2008.html">last
  year's</a> list is the rise of the C++0x thread library stuff.</p>

<ol>

<li><a
href="http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html">Implementing
a Thread-Safe Queue using Condition Variables</a><br> A description of
the issues around writing a thread-safe queue, with code.</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/articles/css_menus.html">Implementing
drop-down menus in pure CSS (no JavaScript)</a><br>How to implement
drop-down menus in CSS in a cross-browser fashion (with a teensy bit
of JavaScript for IE).</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/threading/deadlock_detection_with_just_thread.html">Deadlock
    Detection with just::thread</a><br>This article describes how to
  use the special deadlock-detection mode of
  our <a href="http://www.stdthread.co.uk"><code>just::thread</code>
    C++0x thread library</a> to locate the cause of deadlocks.</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/reviews/programming-with-posix-threads-by-david-butenhof.html">10
Years of Programming with POSIX Threads</a><br>A review of
"Programming with POSIX Threads" by David Butenhof, 10 years after
publication.</li>

<li><a href="http://www.justsoftwaresolutions.co.uk/news/just_thread_C++0x_thread_library_v1.0_released.html">just::thread
C++0x Thread Library V1.0 Released</a><br>This is the release
announcement for
our <a href="http://www.stdthread.co.uk"><code>just::thread</code>
C++0x thread library</a>.</li>

<li><a href="http://www.justsoftwaresolutions.co.uk/general/importing-windows-into-virtualbox.html">Importing
an Existing Windows XP Installation into VirtualBox</a><br>This
article describes how I recovered the hard disk of a dead laptop to
run as a VM
under <a href="http://www.virtualbox.org">VirtualBox</a>.</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/threading/thread-interruption-in-boost-thread-library.html">Thread
Interruption in the Boost Thread Library</a><br>A description of the
thread interruption feature of the Boost Thread library.</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-october-2008.html">October
2008 C++ Standards Committee Mailing - New C++0x Working Paper, More
Concurrency Papers Approved</a><br>My summary of the October 2008 C++
committee mailing featuring the first feature-complete draft of the
C++0x standard.</li>

<li><a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-1-starting-threads.html">Multithreading
in C++0x part 1: Starting Threads</a><br>This is the first part of my
  series on the new C++0x thread library. Links to the remaining
  parts are at the end of the article.</li>

<li><a
href="http://www.justsoftwaresolutions.co.uk/cplusplus/rvalue_references_and_perfect_forwarding.html">Rvalue
References and Perfect Forwarding in C++0x</a><br>An introduction to
the new rvalue reference feature of C++0x.</li>

</ol>

<h3>What's coming in 2010?</h3>

<p>Will 2010 be even better than 2009? I hope so. There's a new
  version
  of <code><a href="http://www.stdthread.co.uk">just::thread</a></code>
  coming soon, and there's another ballot on the C++0x working draft
  due in the spring. I'll also be presenting
  at <a href="http://accu.org/conferences">ACCU 2010 in April</a>.</p>

<p>What are you looking forward to in 2010?</p>
<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/news/">news</a> /] <a href="http://www.justsoftwaresolutions.co.uk/news/happy-new-year-2010.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/popular" rel="tag">popular</a>,  <a href="http://technorati.com/tag/articles" rel="tag">articles</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhappy-new-year-2010.html&amp;title=Happy%20New%20Year%202010"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhappy-new-year-2010.html&amp;title=Happy%20New%20Year%202010">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhappy-new-year-2010.html&amp;title=Happy%20New%20Year%202010">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/news/happy-new-year-2010.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>November 2009 C++ Standards Committee Mailing</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-november-2009.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-november-2009.html</guid><pubDate>Tue, 17 Nov 2009 13:44:16 +0000</pubDate><description><![CDATA[
<p>The <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/#mailing2009-11">November
2009 mailing</a> for the C++ Standards Committee was published
last week. This is the post-meeting mailing for the October committee
meeting and contains a <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf">new
working draft</a> incorporating all the proposals accepted at the
October meeting.</p>

<p>As those of you who
read <a href="http://herbsutter.wordpress.com/2009/11/11/trip-report-october-2008-iso-c-standards-meeting/">Herb
Sutter's blog</a>
or <a href="http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/11/06/the-view-or-trip-report-from-the-oct-2009-c-standard-meeting-part-2">Michael
Wong's blog</a> will already know, the big news for concurrency is
that <strong>a proposal for <code>std::async</code> has been
accepted</strong>, and this is reflected in the latest working
draft.</p>

<p>There are 5 concurrency-related papers (of which my name is on one),
which I summarize below:</p>

<h3>Concurrency-related papers</h3>

<dl>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2985.html">N2985:
C and C++ Thread Compatibility</a></dt>

<dd><p>Lawrence Crowl has been through the concurrency and
    multithreading support from the C++ working draft, and compared
    this to that now being added to the C working draft for the next C
    standard. This paper contains his observations and
    recommendations about the potential for compatibility between the
    types and functions provided by the two draft standards. I
    agree with some of his recommendations, and disagree with
    others. No action will be taken by the C++ committee unless his
    recommendations become full proposals.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2992.htm">N2992:
More Collected Issues with Atomics</a></dt>

<dd><p>This is Lawrence Crowl's paper which rounds up various issues
    with the C++ atomics. It was accepted by the committee, and has
    been incorporated into the working draft. The most noticeable
    change is that the atomic types and functions now live in
    the <code>&lt;atomic&gt;</code> header. The macro for identifying
    lock-free atomics has been expanded into a set of macros, one per
    type, and a guarantee has been added that all instances of a type
    are lock-free, or all are not lock-free (rather than it being
    allowed to vary between objects). There is also a clarification
    that if you use compare-exchange operations on a type with padding
    bits then the padding bits will be part of the comparison (which
    will therefore affect <code>atomic&lt;float&gt;</code> or
    similar), plus a few other clarifications.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2996.htm">N2996:
A Simple Asynchronous Call</a></dt>

<dd><p>This paper is by Herb Sutter and Lawrence Crowl, and brings
together their papers from the pre-meeting mailing
(<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2970.pdf">N2970</a>
and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2973.html">N2973</a>)
based on feedback from the committee. This is
the <code>std::async</code> proposal that got accepted, and which has
been incorporated into the working draft.</p>

  <p>The result is that we have a variadic <code>async</code> function
  with an optional launch policy as the first argument, which
  specifies whether the function is to be spawned on a separate
  thread, deferred until <code>get()</code> or <code>wait()</code> is
  called on the returned <code>future</code>, or either, at the choice
  of the implementation.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2997.htm">N2997:
Issues on Futures (Rev. 1)</a></dt>

<dd><p>This is a revision
of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2967.html">N2967</a>
from the pre-meeting mailing, which incorporates feedback from the
committee. This is the version that was accepted, and which has been
incorporated into the working draft. The key change is
that <code>unique_future</code> has been renamed to
just <code>future</code> in order to make things easier to read in
what is anticipated to be the common case.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2999.html">N2999:
Background for issue 887: Clocks and Condition Variables
    (Rev. 1)</a></dt>

<dd><p>This is a minor revision of Detlef's paper from the pre-meeting
mailing
(<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2969.html">N2969</a>). The
changes it proposes have not yet been accepted into the working paper,
and will make it implementation-dependent which clocks can be used for
condition variable waits.</p></dd>

</dl>

<h3>Other concurrency changes in the working draft</h3>

<ul>
<li><code>std::mutex</code> now has a <code>constexpr</code>
  constructor, so namespace-scope objects are guaranteed to be safe
  from initialization order issues. </li>
<li>The return type of the <code>wait_for</code>
  and <code>wait_until</code> member functions
  of <code>std::condition_variable</code>
  and <code>std::condition_variable_any</code> has been changed from
  a <code>bool</code> to a <code>cv_status</code> enum. This makes it
  clear whether the return is due to a signal (or spurious wake) or
  because the operation timed out.</li>
</ul>

<h3>Updated implementation</h3>

<p>Our <a href="http://www.stdthread.co.uk"><code>just::thread</code>
implementation of the C++0x thread library</a> will shortly be updated
to incorporate all these changes (including an implementation
of <code>std::async</code>). Existing customers will get a free
upgrade as usual.</p>

<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/">cplusplus</a> /] <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-november-2009.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/C++" rel="tag">C++</a>,  <a href="http://technorati.com/tag/standards" rel="tag">standards</a>,  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-november-2009.html&amp;title=November%202009%20C%2B%2B%20Standards%20Committee%20Mailing"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-november-2009.html&amp;title=November%202009%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-november-2009.html&amp;title=November%202009%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-november-2009.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>More Chances to Win a copy of just::thread in our Halloween Contest</title><link>http://www.justsoftwaresolutions.co.uk/news/halloween_contest_update.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/halloween_contest_update.html</guid><pubDate>Thu, 29 Oct 2009 17:49:57 +0000</pubDate><description><![CDATA[<div class="rightimage">
<img src="http://www.stdthread.co.uk/halloweencontest/spooky.png" width="150" height="148" alt="Spooky Castle">
</div>

<p>It's been good to see the entries coming in for our <a
href="http://www.stdthread.co.uk/halloweencontest/">Halloween
Contest</a>, and with only two days to go we've decided to add more
chances of winning. A blog post with your concurrency story now counts
as <strong>TWO</strong> entries. You can get a further entry by <a
href="http://www.justsoftwaresolutions.co.uk/news/halloween_contest_update.html#makecomment">commenting
on this blog entry</a>, and yet another by <a
href="http://twitter.com/home?status=Win%20a%20copy%20of%20the%20just::thread%20C%2B%2B0x%20thread%20library%20http://www.stdthread.co.uk/halloweencontest/"
>
tweeting about this contest</a>. If you do everything, that gives you
<strong>four</strong> chances to win!</p>

<p>Not only does <code>just::thread</code> provide a <strong>complete
    implementation of
    the <a href="http://www.stdthread.co.uk/doc/">C++0x standard
    thread library</a> for Windows and Linux</strong>, but it also
    includes
    a <strong><a href="http://www.stdthread.co.uk/doc/deadlockdebug.html">special
    deadlock detection mode</a></strong>. If deadlocks are sucking the
    life out of your multithreaded code then the deadlock detection
    mode can get straight to the heart of the problem and tell you
    which synchronization objects are the cause of the problem, which
    threads are waiting and where. Crucially, the library will also
    tell you <strong>which thread owns each object, and where it took
    ownership</strong>.</p>

<p>Good luck!</p>
<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/news/">news</a> /] <a href="http://www.justsoftwaresolutions.co.uk/news/halloween_contest_update.html">permanent link</a></i><br> <small> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest_update.html&amp;title=More%20Chances%20to%20Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest_update.html&amp;title=More%20Chances%20to%20Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest_update.html&amp;title=More%20Chances%20to%20Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/news/halloween_contest_update.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>Win a copy of just::thread in our Halloween Contest</title><link>http://www.justsoftwaresolutions.co.uk/news/halloween_contest.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/halloween_contest.html</guid><pubDate>Fri, 16 Oct 2009 21:14:54 +0000</pubDate><description><![CDATA[<div class="rightimage">
<img src="http://www.stdthread.co.uk/halloweencontest/spooky.png" width="150" height="148" alt="Spooky Castle">
</div>

<p>Yes, that's right &mdash; this Halloween we've got 3 copies of
  the <a href="http://www.stdthread.co.uk/order.html"><strong><code>just::thread</code>
  portability pack</strong></a> worth &pound;100 to give away. The
  Portability Pack provides implementations
  of <a href="http://www.stdthread.co.uk"><code>just::thread</code></a>
  for both Linux and Windows, so you can use the same code for both
  platforms right off the bat.</p>

<p>Not only does <code>just::thread</code> provide a <strong>complete
    implementation of
    the <a href="http://www.stdthread.co.uk/doc/">C++0x standard
    thread library</a> for Windows and Linux</strong>, but it also
    includes
    a <strong><a href="http://www.stdthread.co.uk/doc/deadlockdebug.html">special
    deadlock detection mode</a></strong>. If deadlocks are sucking the
    life out of your multithreaded code then the deadlock detection
    mode can get straight to the heart of the problem and tell you
    which synchronization objects are the cause of the problem, which
    threads are waiting and where. Crucially, the library will also
    tell you <strong>which thread owns each object, and where it took
    ownership</strong>.</p>

<p><strong><a href="http://www.stdthread.co.uk/halloweencontest/">Enter
this contest now</a></strong> for your chance to win.</p>

<h3>How to enter</h3>

<p>Entering is really easy &mdash; just write a short blog post about
  your concurrency gremlins that links back to the contest page. It
  could be that you'd like to add multithreading to your application
  but don't know where to start, or you're plagued with deadlocks (in
  which case you could use your new copy
  of <a href="http://www.stdthread.co.uk"><code>just::thread</code></a>
  to help you find the cause!) Maybe you've conquered all your
  concurrency problems, in which case I'd like to hear about how you
  did it. <strong>Whatever your story, I want to know</strong> &mdash;
  even a twitter-style 140-character summary would be fine.</p>

<p>Once you've got your blog post up, either
  email <a href="mailto:contest@stdthread.co.uk">contest@stdthread.co.uk</a>,
  or add a comment to this blog entry. <strong>Just make sure you do it before
    the deadline: Halloween, 31st October 2009</strong>. For full
  details and terms and conditions, see
  the <a href="http://www.stdthread.co.uk/halloweencontest/">contest page</a>.</p>

<p>Good luck!</p>
<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/news/">news</a> /] <a href="http://www.justsoftwaresolutions.co.uk/news/halloween_contest.html">permanent link</a></i><br> <small> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest.html&amp;title=Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest.html&amp;title=Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fhalloween_contest.html&amp;title=Win%20a%20copy%20of%20just%3A%3Athread%20in%20our%20Halloween%20Contest">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/news/halloween_contest.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item><item><title>September 2009 C++ Standards Committee Mailing</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-september-2009.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-september-2009.html</guid><pubDate>Wed, 30 Sep 2009 22:06:18 +0000</pubDate><description><![CDATA[
<p>The <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/#mailing2009-09">September
2009 mailing</a> for the C++ Standards Committee was published
today. This is the pre-meeting mailing for the October committee
meeting and contains the first <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf">new
working draft</a> since the "Concepts" feature was voted out of C++0x
in July.</p>

<p>There is also quite a large number of papers in this mailing,
including 7 concurrency-related papers (of which my name is on 2),
which I summarize below:</p>

<h3>Concurrency-related papers</h3>

<dl>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2955.html">N2955:
Comments on the C++ Memory Model Following a Partial Formalization Attempt</a></dt>

<dd><p>Mark has been working on a formal model for parts of the C++
memory model, and has identified a few cases where the wording could
be improved to clarify things.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2959.html">N2959:
Managing the lifetime of thread_local variables with contexts (Revision 1)</a></dt>

<dd><p>This is a revision of my earlier paper, <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2907.html">N2907</a>
which expands my proposal for a <code>thread_local_context</code>
class, along with full proposed wording. I think this provides a
workable solution to the general problem of ensuring that destructors
for <code>thread_local</code> variables are run at particular points
in the execution of a program as discussed in <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html">N2880</a>.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2967.html">N2967:
Issues on Futures</a></dt>

<dd><p>This paper that I co-authored with Detlef Vollmann provides a
complete rewording for the "Futures" section of the standard
(30.6). It folds the proposed changes from <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2888.html">N2888</a>
in with changes requested by the LWG at July's meeting (including the
addition of a new future type &mdash; <code>atomic_future</code> which
serializes all operations), and editorial comments on the earlier
wording. It doesn't resolve everything &mdash; there is still some
discussion over whether <code>unique_future::get()</code> should
return a value or a reference, for example &mdash; but it provides a
sound basis for further discussion.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2969.html">N2969:
Background for issue 887: Clocks and Condition Variables</a></dt>

<dd><p>Detlef argues the case that
<code>std::condition_variable::wait_for</code> and
<code>std::condition_variable::wait_until</code> may wake "too late"
if the user adjusts the system clock during a wait, and suggests
simplifying the overload set to match the minimum requirements of
POSIX. LWG has already decided that this is Not A Defect (NAD), and I
agree &mdash; there are no guarantees about how soon after the
specified timeout the wait will return, and this is thus entirely a
quality of implementation issue.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2970.pdf">N2970:
A simple async() (revision 1)</a></dt>

<dd><p>This is a revision to Herb Sutter's take on a
<code>std::async</code> function. There is a lot of discussion around
the various issues, but the proposed wording seems incomplete &mdash;
for example, if the <code>unique_future</code> associated with a
<code>synchronous</code> <code>async</code> call is moved into a
<code>shared_future</code> which is then copied, which call to
<code>get()</code> runs the task?</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2973.html">N2973:
An Asynchronous Call for C++</a></dt>

<dd><p>This is a revision to Lawrence Crowl's take on a
<code>std::async</code> function. Whilst better specified than N2970
(a "serial" task is invoked in <code>unique_future::get()</code>
<em>or</em> when the <code>unique_future</code> is moved into a
<code>shared_future</code>), I'm not entirely happy with the result.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2974.html">N2974:
An Analysis of Async and Futures</a></dt>

<dd><p>To aid the committee with deciding on the semantics of
<code>std::async</code>, Lawrence has put together this paper which
outlines various options for creating futures from an
<code>async</code> function. He then goes on to outline the operations
that we may wish to perform on those futures, and how they relate to
the various options for <code>async</code>.</p></dd>

</dl>

<p>As you can see by the 3 papers on the issue,
<code>std::async</code> is a hot topic. I hope that a single coherent
design can be agreed on at Santa Cruz, and incorporated into the
standard. <a
href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-september-2009.html#makecomment">Comment
on this blog post</a> if you've got an opinion on the matter, and I'll
pass it on.</p>

<h3>Other papers</h3>

<p>As I said at the beginning of this post, there are quite a few
papers in this mailing. Other than the <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf">new
working draft</a>, there were 3 papers that piqued my interest:</p>

<ul>
<li><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html">N2954:
Unified Function Syntax</a> which proposes allowing lambda-style
syntax for normal functions,</li>
<li><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2953.html">N2953:
Defining Move Special Member Functions</a> which covers the implicit
generation of move constructors and move assignment operators, and</li>
<li><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2951.html">N2951:
forward</a> which covers the usage and constraints on
<code>std::forward</code></li>
</ul>

<p>Other papers include changes to the allocator proposals, papers to
cover specific core issues, a couple of papers on type traits and a
couple on pairs and tuples. See the <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/#mailing2009-09">full
paper list</a> for further details.</p>
<p align="right">Posted by Anthony Williams<br><i>[/  <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/">cplusplus</a> /] <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-september-2009.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/C++" rel="tag">C++</a>,  <a href="http://technorati.com/tag/standards" rel="tag">standards</a>,  <a href="http://technorati.com/tag/concurrency" rel="tag">concurrency</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-september-2009.html&amp;title=September%202009%20C%2B%2B%20Standards%20Committee%20Mailing"> Stumble It! <img src="http://www.justsoftwaresolutions.co.uk/images/stumbleupon.png" width=16 height=16 class="sm" alt="stumbleupon logo"></a> | <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-september-2009.html&amp;title=September%202009%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to Reddit <img src="http://www.justsoftwaresolutions.co.uk/images/reddit.png" width=16 height=16 class="sm" alt="reddit logo"></a> | <a href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fcplusplus-standards-committee-mailing-september-2009.html&amp;title=September%202009%20C%2B%2B%20Standards%20Committee%20Mailing">Submit to DZone <img src="http://www.justsoftwaresolutions.co.uk/images/dzone.png" width=16 height=16 class="sm" alt="dzone logo"></a></small></p><p><a href="http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-september-2009.html#makecomment">Comment on this post</a></p><p>Follow me on <a href="http://twitter.com/a_williams">Twitter</a></p>]]></description></item></channel></rss>