<?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>Implementing Dekker&#039;s algorithm with Fences</title><link>http://www.justsoftwaresolutions.co.uk/threading/implementing_dekkers_algorithm_with_fences.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/threading/implementing_dekkers_algorithm_with_fences.html</guid><pubDate>Tue, 27 Jul 2010 11:50:26 +0100</pubDate><description><![CDATA[
<p><a href="http://en.wikipedia.org/wiki/Dekker%27s_algorithm">Dekker's
  algorithm</a> is one of the most basic algorithms for mutual
  exclusion,
  alongside <a href="http://en.wikipedia.org/wiki/Peterson%27s_algorithm">Peterson's
  algorithm</a>
  and <a href="http://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm">Lamport's
  bakery algorithm</a>. It has the nice property that it only requires
  load and store operations rather than exchange or test-and-set, but
  it still requires some level of ordering between the operations. On
  a weakly-ordered architecture such as PowerPC or SPARC, a correct
  implementation of Dekker's algorithm thus requires the use of fences
  or memory barriers in order to ensure correct operation.</p>

<h4>The code</h4>

<p>For those of you who just want the code: here it is &mdash;
  Dekker's algorithm in C++, with explicit fences.</p>

<pre class="listing">
std::atomic&lt;bool&gt; flag0(false),flag1(false);
std::atomic&lt;int&gt; turn(0);

void p0()
{
    flag0.store(true,std::memory_order_relaxed);
    std::atomic_thread_fence(std::memory_order_seq_cst);

    while (flag1.load(std::memory_order_relaxed))
    {
        if (turn.load(std::memory_order_relaxed) != 0)
        {
            flag0.store(false,std::memory_order_relaxed);
            while (turn.load(std::memory_order_relaxed) != 0)
            {
            }
            flag0.store(true,std::memory_order_relaxed);
            std::atomic_thread_fence(std::memory_order_seq_cst);
        }
    }
    std::atomic_thread_fence(std::memory_order_acquire);
 
    // critical section


    turn.store(1,std::memory_order_relaxed);
    std::atomic_thread_fence(std::memory_order_release);
    flag0.store(false,std::memory_order_relaxed);
}

void p1()
{
    flag1.store(true,std::memory_order_relaxed);
    std::atomic_thread_fence(std::memory_order_seq_cst);

    while (flag0.load(std::memory_order_relaxed))
    {
        if (turn.load(std::memory_order_relaxed) != 1)
        {
            flag1.store(false,std::memory_order_relaxed);
            while (turn.load(std::memory_order_relaxed) != 1)
            {
            }
            flag1.store(true,std::memory_order_relaxed);
            std::atomic_thread_fence(std::memory_order_seq_cst);
        }
    }
    std::atomic_thread_fence(std::memory_order_acquire);
 
    // critical section


    turn.store(0,std::memory_order_relaxed);
    std::atomic_thread_fence(std::memory_order_release);
    flag1.store(false,std::memory_order_relaxed);
}
</pre>

<h4>The analysis</h4>

<p>If you're like me then you'll be interested in <em>why</em> stuff
works, rather than just taking the code. Here is my analysis of the
required orderings, and how the fences guarantee those orderings.</p>

<p>Suppose thread 0 and thread 1 enter <code>p0</code>
and <code>p1</code> respectively at the same time. They both set their
respective flags to <code>true</code>, execute the fence and then read
the other flag at the start of the <code>while</code> loop.</p>

<p>If both threads read <code>false</code> then both will enter the
critical section, and the algorithm doesn't work. It is the job of the
fences to ensure that this doesn't happen.</p>

<p>The fences are marked with <code>memory_order_seq_cst</code>, so either the
  fence in <code>p0</code> is before the fence in <code>p1</code> in the global ordering of
  <code>memory_order_seq_cst</code> operations, or vice-versa. Without
  loss of generality, we can assume that the fence in <code>p0</code>
  comes before the fence in <code>p1</code>, since the code is
  symmetric. The store to <code>flag0</code> is sequenced before the
  fence in <code>p0</code>, and the fence in <code>p1</code> is
  sequenced before the read from <code>flag0</code>. Therefore the
  read from <code>flag0</code> must see the value stored
  (<code>true</code>), so <code>p1</code> will enter
  the <code>while</code> loop.</p>

<p>On the other side, there is no such guarantee for the read
from <code>flag1</code> in <code>p0</code>, so <code>p0</code> may or
may not enter the <code>while</code> loop. If <code>p0</code> reads
the value of <code>false</code> for <code>flag1</code>, it will not
enter the <code>while</code> loop, and will instead enter the critical
section, but that is OK since <code>p1</code> has entered
the <code>while</code> loop.</p>

<p>Though <code>flag0</code> is not set to <code>false</code>
until <code>p0</code> has finished the critical section, we need to
ensure that <code>p1</code> does not see this until the values
modified in the critical section are also visible to <code>p1</code>,
and this is the purpose of the release fence prior to the store
to <code>flag0</code> and the acquire fence after
the <code>while</code> loop. When <code>p1</code> reads the
value <code>false</code> from
  <code>flag0</code> in order to exit the <code>while</code> loop, it
must be reading the value store by <code>p0</code> after the release
fence at the end of the critical section. The acquire fence after the
load guarantees that all the values written before the release fence
prior to the store are visible, which is exactly what we need
here.</p>

<p>If <code>p0</code> reads <code>true</code> for <code>flag1</code>,
  it will enter the <code>while</code> loop rather than the critical
  section. Both threads are now looping, so we need a way to ensure
  that exactly one of them breaks out. This is the purpose of
  the <code>turn</code> variable. Initially, turn is 0,
  so <code>p1</code> will enter the <code>if</code> and
  set <code>flag1</code> to <code>false</code>, whilst <code>p1</code>
  will not enter the <code>if</code>. Because <code>p1</code> set
  <code>flag1</code> to <code>false</code>, eventually <code>p0</code>
  will read <code>flag1</code> as <code>false</code> and exit the
  outer <code>while</code> loop to enter the critical section. On the
  other hand, <code>p1</code> is now stuck in the
  inner <code>while</code> loop because <code>turn</code> is
  0. When <code>p0</code> exits the critical section it
  sets <code>turn</code> to 1. This will eventually be seen
  by <code>p1</code>, allowing it to exit the inner <code>while</code>
  loop. When the store to
  <code>flag0</code> becomes visible <code>p1</code> can then exit the
  outer <code>while</code> loop too.</p>

<p>If <code>turn</code> had been 1 initially (because <code>p0</code>
  was the last thread to enter the critical section) then the inverse
  logic would apply, and <code>p0</code> would enter the inner loop,
  allowing <code>p1</code> to enter the critical section first.</p>

<h4>Second time around</h4>

<p>If <code>p0</code> is called a second time whilst <code>p1</code>
  is still in the inner loop then we have a similar situation to the
  start of the function &mdash; <code>p1</code> may exit the inner
  loop and store <code>true</code> in <code>flag1</code>
  whilst <code>p0</code> stores <code>true</code>
  in <code>flag0</code>. We therefore need the
  second <code>memory_order_seq_cst</code> fence after the store to
  the flag in the inner loop. This guarantees that
  at least one of the threads will see the flag from the other thread
  set when it executes the check in the outer loop. Without this fence
  then both threads can read <code>false</code>, and both can enter
  the critical section.</p>

<h4>Alternatives</h4>

<p>You could put the ordering constraints on the loads and stores
  themselves rather than using fences. Indeed, the default memory
  ordering for atomic operations in C++
  is <code>memory_order_seq_cst</code>, so the algorithm would "just
  work" with plain loads and stores to atomic variables. However, by
  using <code>memory_order_relaxed</code> on the loads and stores we
  can add fences to ensure we have exactly the ordering constraints
  required.</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/implementing_dekkers_algorithm_with_fences.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/synchronization" rel="tag">synchronization</a>,  <a href="http://technorati.com/tag/Dekker" rel="tag">Dekker</a>,  <a href="http://technorati.com/tag/fences" rel="tag">fences</a>,  <a href="http://technorati.com/tag/cplusplus" rel="tag">cplusplus</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fthreading%2Fimplementing_dekkers_algorithm_with_fences.html&amp;title=Implementing%20Dekker%27s%20algorithm%20with%20Fences"> 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%2Fimplementing_dekkers_algorithm_with_fences.html&amp;title=Implementing%20Dekker%27s%20algorithm%20with%20Fences">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%2Fimplementing_dekkers_algorithm_with_fences.html&amp;title=Implementing%20Dekker%27s%20algorithm%20with%20Fences">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/implementing_dekkers_algorithm_with_fences.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>Reference Wrappers Explained</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/reference_wrappers_explained.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/reference_wrappers_explained.html</guid><pubDate>Wed, 14 Jul 2010 18:04:50 +0100</pubDate><description><![CDATA[
<p>The
upcoming <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">C++0x
standard</a> includes <em>reference wrappers</em> in the form of
the <code>std::reference_wrapper&lt;T&gt;</code> class template, and
the helper function templates <code>std::ref()</code>
and <code>std::cref()</code>. As I mentioned in my blog post
on <a href="http://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-3.html">Starting
Threads with Member Functions and Reference Arguments</a>, these
wrappers can be used to pass references to objects across interfaces
that normally require copyable (or at least <em>movable</em>) objects
&mdash; in that blog post, <code>std::ref</code> was used for passing
references to objects over to the new thread, rather than copying the
objects. I was recently asked what the difference was
between <code>std::ref</code> and <code>std::cref</code>, and how they
worked, so I thought I'd elaborate.</p>

<h4>Deducing the Referenced Type</h4>

<p><code>std::ref</code> is a function template, so automatically
  deduces the type of the wrapped reference from the type of the
  supplied argument. This type deduction includes
  the <code>const</code>-ness of the supplied object:</p>

<pre class="listing">
int x=3;
const int y=4;
std::reference_wrapper&lt;int&gt; rx=std::ref(x);
// std::reference_wrapper&lt;int&gt; ry=std::ref(y); // error
std::reference_wrapper&lt;const int&gt; rcy=std::ref(y);
</pre>

<p>On the other hand, though <code>std::cref</code> also deduces the
  type of the wrapped reference from the supplied argument,
  it <em>always</em> wraps a <code>const</code> reference:</p>

<pre class="listing">
int x=3;
const int y=4;
// std::reference_wrapper&lt;int&gt; rx=std::cref(x); // error
std::reference_wrapper&lt;const int&gt; rcx=std::cref(x);
// std::reference_wrapper&lt;int&gt; ry=std::cref(y); // error
std::reference_wrapper&lt;const int&gt; rcy=std::cref(y);
</pre>

<p>Since a no-<code>const</code>-reference can always be bound to
  a <code>const</code> reference, you can thus
  use <code>std::ref</code> in pretty much every case where you would
  use <code>std::cref</code>, and your code would work the same. Which
  begs the question: why would you ever choose to
  use <code>std::cref</code>?</p>

<h4>Using <code>std::cref</code> to prevent modification</h4>

<p>The primary reason for choosing <code>std::cref</code> is because
  you want to guarantee that the source object is not modified through
  that reference. This can be important when writing multithreaded
  code &mdash; if a thread should not be modifying some data then it
  can be worth enforcing this by passing a <code>const</code>
  reference rather than a mutable reference.</p>

<pre class="listing">
void foo(int&amp;); // mutable reference

int x=42; // Should not be modified by thread
std::thread t(foo,std::cref(x)); // will fail to compile
</pre>

<p>This can be important where there are overloads of a function such
  that one takes a <code>const</code> reference, and the other a
  non-<code>const</code> reference: if we don't want the object
  modified then it is important that the overload taking
  a <code>const</code> reference is chosen.</p>

<pre class="listing">
struct Foo
{
    void operator()(int&amp;) const;
    void operator()(int const&amp;) const;
};

int x=42;
std::thread(Foo(),std::cref(x)); // force const int&amp; overload 
</pre>

<h4>References to temporaries</h4>

<p><code>std::cref</code> has another property missing
  from <code>std::ref</code> &mdash; it can bind to temporaries, since
  temporary objects can bind to <code>const</code> references. I'm
  not sure this is a good thing, especially when dealing with multiple
  threads, as the referenced temporary is likely to have been
  destroyed before the thread has even started. This is therefore
  something to watch out for:</p>

<pre class="listing">
void bar(int const&amp;);

std::thread t(bar,std::cref(42)); // oops, ref to temporary
</pre>


<h4>Documentation</h4>

<p>Finally, <code>std::cref</code> serves a documentation purpose,
  even where <code>std::ref</code> would suffice &mdash; it declares
  in big bold letters that this reference cannot be used to modify the
  referenced object, which thus makes it easier to reason about the
  code.</p>

<h4>Recommendation</h4>

<p>I would recommend that you use <code>std::cref</code> in preference
  to <code>std::ref</code> whenever you can &mdash; the benefits as
  documentation of intent, and avoiding accidental modification
  through the reference make it a clear winner in my opinion. Of
  course, if you <strong>do</strong> want to modify the referenced
  object, then you need to use <code>std::ref</code>, but such usage
  now stands out, and makes it clear that this is the intent.</p>

<p>You do still need to be careful to ensure that you don't try and
  wrap references to temporaries, particularly when
  applying <code>std::cref</code> to the result of a function call,
  but such uses should stand out &mdash; I expect most uses to be
  wrapping a reference to a named variable rather than wrapping a
  function result.</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/reference_wrappers_explained.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/reference+wrappers" rel="tag">reference wrappers</a>,  <a href="http://technorati.com/tag/ref" rel="tag">ref</a>,  <a href="http://technorati.com/tag/cref" rel="tag">cref</a>,  <a href="http://technorati.com/tag/cplusplus" rel="tag">cplusplus</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Freference_wrappers_explained.html&amp;title=Reference%20Wrappers%20Explained"> 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%2Freference_wrappers_explained.html&amp;title=Reference%20Wrappers%20Explained">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%2Freference_wrappers_explained.html&amp;title=Reference%20Wrappers%20Explained">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/reference_wrappers_explained.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>Last day for comments on the C++0x FCD</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/last-day-for-fcd-comments-on-c++0x.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/last-day-for-fcd-comments-on-c++0x.html</guid><pubDate>Thu, 17 Jun 2010 23:04:42 +0100</pubDate><description><![CDATA[
<p>The BSI deadline for comments on
the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf">C++0x
FCD</a> is tomorrow, Friday 18th June 2010. The ISO deadline is 26th
July 2010, but we have to write up comments for submission in the form
required for ISO, which takes time.</p>

<p>If you have a comment on the FCD, please see
  my <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">earlier
  blog post</a> for how to submit it to BSI. Help us make the C++0x
  standard as good as it can be.</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/last-day-for-fcd-comments-on-c++0x.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/C++" rel="tag">C++</a>,  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/WG21" rel="tag">WG21</a>,  <a href="http://technorati.com/tag/FCD" rel="tag">FCD</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Flast-day-for-fcd-comments-on-c%2B%2B0x.html&amp;title=Last%20day%20for%20comments%20on%20the%20C%2B%2B0x%20FCD"> 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%2Flast-day-for-fcd-comments-on-c%2B%2B0x.html&amp;title=Last%20day%20for%20comments%20on%20the%20C%2B%2B0x%20FCD">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%2Flast-day-for-fcd-comments-on-c%2B%2B0x.html&amp;title=Last%20day%20for%20comments%20on%20the%20C%2B%2B0x%20FCD">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/last-day-for-fcd-comments-on-c++0x.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>Enforcing Correct Mutex Usage with Synchronized Values</title><link>http://www.justsoftwaresolutions.co.uk/news/enforcing_correct_mutex_usage_with_synchronized_values.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/enforcing_correct_mutex_usage_with_synchronized_values.html</guid><pubDate>Fri, 28 May 2010 14:56:06 +0100</pubDate><description><![CDATA[
<p>My latest article, <a
href="http://www.drdobbs.com/cpp/225200269">Enforcing Correct Mutex
Usage with Synchronized Values</a> has been published on the Dr Dobb's
website.</p>

<p>This article expands on the <code>SynchronizedValue&lt;T&gt;</code>
template I mentioned in my presentation
on <a href="http://www.justsoftwaresolutions.co.uk/news/concurrency_in_the_real_world_slides.html">Concurrency
in the Real World</a> at ACCU 2010, and deals with the problem of
ensuring that the mutex associated with some data is locked whenever
the data is accessed.</p>

<p>The basic idea is that you
  use <code>SynchronizedValue&lt;T&gt;</code> wherever you have
  an object of type <code>T</code> that you wish to be protected with
  its own mutex. The <code>SynchronizedValue&lt;T&gt;</code> then
  behaves like a pointer-to-<code>T</code> for simple uses.</p>

<p>Read <a href="http://www.drdobbs.com/cpp/225200269">the article</a>
  for the full details.</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/enforcing_correct_mutex_usage_with_synchronized_values.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/mutex" rel="tag">mutex</a>,  <a href="http://technorati.com/tag/cplusplus" rel="tag">cplusplus</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fenforcing_correct_mutex_usage_with_synchronized_values.html&amp;title=Enforcing%20Correct%20Mutex%20Usage%20with%20Synchronized%20Values"> 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%2Fenforcing_correct_mutex_usage_with_synchronized_values.html&amp;title=Enforcing%20Correct%20Mutex%20Usage%20with%20Synchronized%20Values">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%2Fenforcing_correct_mutex_usage_with_synchronized_values.html&amp;title=Enforcing%20Correct%20Mutex%20Usage%20with%20Synchronized%20Values">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/enforcing_correct_mutex_usage_with_synchronized_values.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.4 (FCD Edition) Released</title><link>http://www.justsoftwaresolutions.co.uk/news/just-thread-c++0x-thread-library-fcd-edition-released.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/just-thread-c++0x-thread-library-fcd-edition-released.html</guid><pubDate>Thu, 06 May 2010 16:08:57 +0100</pubDate><description><![CDATA[
<p>I am pleased to announce that version 1.4 (the FCD edition)
  of <a href="http://www.stdthread.co.uk"><code>just::thread</code></a>,
  our <a href="http://www.stdthread.co.uk">C++0x Thread Library</a>
  has just been released.</p>

<p>With the release of the "FCD edition", <code>just::thread</code>
  provides the first complete implementation of the multithreading
  facilities from
  the <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">Final
  Committee Draft (FCD) of the C++0x standard</a>.</p>

<p>Changes include:</p>
<ul>
  <li> New <a href="http://www.stdthread.co.uk/doc/headers/future/promise/set_value_at_thread_exit.html"><code>promise::set_value_at_thread_exit</code></a>,
    <a href="http://www.stdthread.co.uk/doc/headers/future/promise/set_exception_at_thread_exit.html"><code>promise::set_exception_at_thread_exit</code></a>, and
    <a href="http://www.stdthread.co.uk/doc/headers/future/packaged_task/make_ready_at_thread_exit.html"><code>packaged_task::make_ready_at_thread_exit</code></a> member functions to defer
    unblocking waiting threads until the notifying thread exits</li>
  <li>
    New <a href="http://www.stdthread.co.uk/doc/headers/condition_variable/condition_variable/notify_all_at_thread_exit.html"><code>notify_all_at_thread_exit
    function</code></a> for notifying condition variables when the
    notifying thread exits</li>
  <li>
    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 <a href="http://www.stdthread.co.uk/doc/headers/future/future.html"><code>future</code></a>, <a href="http://www.stdthread.co.uk/doc/headers/future/shared_future.html"><code>shared_future</code></a> and
    <a href="http://www.stdthread.co.uk/doc/headers/future/atomic_future.html"><code>atomic_future</code></a>
    return a <code>future_status</code> enum rather
    than <code>bool</code> to indicate whether the future is ready,
    the wait timed out, or the future contains a deferred async
    function</li>
  <li> The destructor of the last future associated with an async function
    waits for that function to complete.</li>
  <li> New <a href="http://www.stdthread.co.uk/doc/headers/atomic/atomic_var_init_macro.html"><code>ATOMIC_VAR_INIT</code></a> macro for initializing atomic objects</li>
  <li> The callable object for a <a href="http://www.stdthread.co.uk/doc/headers/future/packaged_task.html"><code>packaged_task</code></a> is destroyed with the
    <a href="http://www.stdthread.co.uk/doc/headers/future/packaged_task.html"><code>packaged_task</code></a>
    rather than being kept alive until the future is destroyed</li>
</ul>


<strong><a href="http://www.stdthread.co.uk/order.html">Purchase your
copy</a> and get started with the C++0x thread library NOW.</strong></p>

<p>As usual, existing customers are entitled to a free upgrade to V1.4.0
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-fcd-edition-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-fcd-edition-released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.4%20%28FCD%20Edition%29%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-fcd-edition-released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.4%20%28FCD%20Edition%29%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-fcd-edition-released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.4%20%28FCD%20Edition%29%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-fcd-edition-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>&quot;Concurrency in the Real World&quot; slides now available</title><link>http://www.justsoftwaresolutions.co.uk/news/concurrency_in_the_real_world_slides.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/concurrency_in_the_real_world_slides.html</guid><pubDate>Mon, 19 Apr 2010 22:18:07 +0100</pubDate><description><![CDATA[
<p>The <a href="http://www.justsoftwaresolutions.co.uk/files/concurrency_in_the_real_world.pdf">slides</a>
  for my presentation
  on <a href="http://accu.org/index.php/conferences/accu_conference_2010/accu2010_sessions#Using%20Concurrency%20in%20the%20Real%20World">"Concurrency
  in the Real World"</a> at the ACCU 2010 conference last week are now
  available.</p>

<p>The room was full, and quite warm due to the air conditioning
  having been turned off, but everything went to plan, and there were
  some insightful questions from the audience. I've thoroughly enjoyed
  presenting at ACCU in previous years, and this was no exception.</p>

<p>I covered the main pitfalls people encounter when writing
  multithreaded code, along with some techniques that I've found help
  deal with those problems, including some example code from projects
  I've worked on. As you might expect, all my examples were in C++,
  though the basic ideas are cross-language. I finished up by talking
  about what we might hope to get out of multithreaded code, such as
  performance, additional features and responsiveness.</p>

<p>There's a discount on
  my <a href="http://www.stdthread.co.uk/accu2010/"><code>just::thread</code></a>
  library until Friday 23rd April 2010, so if you're doing concurrency
  in C++ with Microsoft Visual Studio on Windows or g++ on linux get
  yourself a copy whilst it's on offer and start taking advantage of
  the new
  <a href="http://www.stdthread.co.uk/accu2010/">C++0x thread
  library</a>.</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/concurrency_in_the_real_world_slides.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++" rel="tag">c++</a>,  <a href="http://technorati.com/tag/ACCU" rel="tag">ACCU</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fconcurrency_in_the_real_world_slides.html&amp;title=%22Concurrency%20in%20the%20Real%20World%22%20slides%20now%20available"> 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%2Fconcurrency_in_the_real_world_slides.html&amp;title=%22Concurrency%20in%20the%20Real%20World%22%20slides%20now%20available">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%2Fconcurrency_in_the_real_world_slides.html&amp;title=%22Concurrency%20in%20the%20Real%20World%22%20slides%20now%20available">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/concurrency_in_the_real_world_slides.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>March 2010 C++ Standards Committee Mailing</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-march-2010.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/cplusplus-standards-committee-mailing-march-2010.html</guid><pubDate>Thu, 08 Apr 2010 10:17:03 +0100</pubDate><description><![CDATA[
<p>The <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/#mailing2010-03">March
2010 mailing</a> for the C++ Standards Committee was published last
week. This is the post-meeting mailing for the March 2010 committee
meeting, and contains
the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf">C++0x
Final Committee Draft</a>, which
  I <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">blogged
    about last week</a>.</p>

<p>There are 6 concurrency-related papers (of which my name is on two),
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/n3057.html">N3057:
Explicit Initializers for Atomics</a></dt>

<dd><p>This paper proposes new initializers for atomic variables,
    providing a means of writing code which can be compiled as either
    C or C++. e.g.</p>

<pre>
void foo()
{
    atomic_int a=ATOMIC_VAR_INIT(42); // initialize a with 42
    atomic_uint b;                    // uninitialized
    atomic_init(&amp;b,123);          // b now initialized to 123
}
</pre>
</dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3058.html">N3058:
Futures and Async Cleanup (Rev.)</a></dt>

<dd><p>This is a revision
of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3041.html">N3041</a>
to resolve many of the outstanding issues with futures and
    async. Mostly it's just wordsmithing to tidy up the specification,
    but there's a few key changes:</p>

<ul>
<li>Defined behaviour for
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_for.html">wait_for()</a></code>
  and <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_until.html">wait_until()</a></code>
  member functions
  of <code><a href="http://www.stdthread.co.uk/doc/headers/future/future.html">std::future</a></code>, <code><a href="http://www.stdthread.co.uk/doc/headers/future/shared_future.html">std::shared_future</a></code>
  and <code><a href="http://www.stdthread.co.uk/doc/headers/future/atomic_future.html">std::atomic_future</a></code>
  when used
  with <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  and a launch policy of <code>std::launch::sync</code>. The return
  value is now a value of the new <code>std::future_status</code>
  enumeration, and can be <code>std::future_status::ready</code> if
  the future becomes <em>ready</em> before the
  timeout, <code>std::future_status::timeout</code> if the wait times
  out, or <code>std::future_status::deferred</code> if the future
  comes from a call
  to <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  with a launch policy of <code>std::launch::sync</code> and the
  function associated with the future hasn't yet started execution on
  any thread.</li>
<li>The wording
  for <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  adopts the same wording
  as <code><a href="http://www.stdthread.co.uk/doc/headers/thread/thread.html">std::thread</a></code>
  to clarify the copy/move and perfect forwarding semantics of the
  call.</li>
</ul>

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

<dd><p>This is a revision
of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3040.html">N3040</a>,
    and highlights which operations through iterators constitute
    accesses and data races, and explicitly allows for synchronization
    by writing and reading to/from a stream.</p>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3070.html">N3070:
    Handling Detached Threads and <code>thread_local</code> Variables</a></dt>

<dd><p>This is a hugely simplified replacement for my previous
paper <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3038.html">N3038</a>. Rather
than creating contexts for <code>thread_local</code> variables, this
paper proposes new member functions
for <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>
and <code><a href="http://www.stdthread.co.uk/doc/headers/future/packaged_task.html">std::packaged_task</a></code>
to allow the value to be set at the point of call, but threads waiting
on associated futures to be woken only after <code>thread_local</code>
variables have been destroyed at thread exit. This means that you can
now safely wait on a future which is set in such a fashion when
waiting for a task running on a background thread to complete, without
having to join with the thread or worry about races arising from the
destructors of <code>thread_local</code> variables. The paper also
    adds a similar mechanism for condition variables as a non-member function.</p></dd>


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

<dd><p>This is a revision
of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3042.html">N3042</a>
proposing renaming <code>std::launch::any</code>
to <code>std::launch::sync_or_async</code>. <strong>This paper was not
approved</strong>.</p></dd>

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

<dd><p>This is a revision
of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3045.html">N3045</a>. 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 are the following 3
  papers. Check
  the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/#mailing2010-03">mailing</a>
  for the full set.</p>

<dl>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050:
Allowing Move Constructors to Throw (Rev. 1)</a></dt>

<dd><p>This paper adds the new <code>noexcept</code> keyword to
    C++. This is used in place of an exception specification. On its
    own it means that the function does not throw any exceptions, but
    it can also be used with a boolean constant expression
    where <code>true</code> means that the function doesn't throw,
    and <code>false</code> means that it might. e.g.</p>

<pre>
void foo() noexcept;        // will not throw
void bar() noexcept(true);  // will not throw
void baz() noexcept(false); // may throw
</pre>

  <p>If a <code>noexcept</code> exception specification is violated
    then <code>std::terminate()</code> is called.</p>

  <p>The primary benefit from the boolean-constant-expression version
  is in templates, where the boolean expression can check various
  properties of the template parameter types. One of the things you
  can check is whether or not particular operations throw, e.g. by
    using the new <code>has_nothrow_move_constructor</code> type trait
    to declare the move constructor for a class to
    be <code>noexcept</code> if its class members have non-throwing
  move constructors:</p>

<pre>
template&lt;typename T&gt;
class X
{
    T data;
public:
    X(X&& other)
        noexcept(std::has_nothrow_move_constructor&lt;T&gt;::value):
        data(std::move(other.data))
    {}
};
</pre>
</dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html">N3053:
Defining Move Special Member Functions</a></dt>

<dd><p>This proposal ensures that user-defined classes have move
    constructors and move assignment operators generated for them by
    the compiler if that is safe. Explicitly declaring a copy or move
    constructor will prevent the implicit declaration of the other,
    and likewise for copy and move assignment. You can always request
    the default definition using the <code>= default</code>
    syntax.</p>

  <p>This means that lots of user code will now be able to readily
  take advantage of move semantics with a simple code change or even
  just a recompile. This can potentially be of major performance
    benefit.</p></dd>

<dt><a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3055.pdf">N3055:
A Taxonomy of Expression Value Categories</a></dt>

<dd><p>This paper nails down the true distinctions between lvalues,
    rvalues and rvalue references. It provides a new set of names to
    identify the distinct categories of values in C++ &mdash; lvalues
    and rvalues we already have, but now there's xvalues, prvalues and
    glvalues too. This categorization allows for better specification
    of when things can bind to lvalue references or rvalue references,
    when the compiler can eliminate copies or moves.</p></dd>
</dl>

<h3>Please comment on the FCD</h3>

<p>The purpose of
the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf">C++0x
Final Committee Draft</a> is to get comments prior to publication to
ensure the final C++0x standard is as defect free as possible. This
opportunity is only available for a limited time, so
please <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">comment
on the FCD</a>.</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-march-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-march-2010.html&amp;title=March%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-march-2010.html&amp;title=March%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-march-2010.html&amp;title=March%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-march-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>Sign up for a 50% discount just::thread FCD edition</title><link>http://www.justsoftwaresolutions.co.uk/news/just-thread-fcd-discount.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/just-thread-fcd-discount.html</guid><pubDate>Wed, 07 Apr 2010 16:20:13 +0100</pubDate><description><![CDATA[
<p>I'm in the process of updating
  our <a href="http://www.stdthread.co.uk">C++0x thread library for
  VS2008, VC10, g++ 4.3 and g++ 4.4</a> to incorporate the changes to
  the C++0x thread library voted into
  the <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html">C++0x
  FCD</a>. I'll be writing a blog post with more details in due
  course, but the big changes are:</p>

<ul>
<li>Functions for postponing notification of threads waiting on a
  <code><a href="http://www.stdthread.co.uk/doc/headers/future/future.html">std::future</a></code>
  until the thread that set the value on
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/promise.html">std::promise</a></code>
  or ran
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/packaged_task.html">std::packaged_task</a></code>
  has exited.</li>
<li>A similar facility for notifying
  a <code><a href="http://www.stdthread.co.uk/doc/headers/condition_variable/condition_variable.html">std::condition_variable</a></code>
  at thread exit.</li>
<li>Defined behaviour for
  the <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_for.html">wait_for()</a></code>
  and <code><a href="http://www.stdthread.co.uk/doc/headers/future/future/wait_until.html">wait_until()</a></code>
  member functions
  of <code><a href="http://www.stdthread.co.uk/doc/headers/future/future.html">std::future</a></code>
  when used
  with <code><a href="http://www.stdthread.co.uk/doc/headers/future/async.html">std::async</a></code>
  and a launch policy of <code>std::launch::sync</code>.</li>
<li>Changes to the initialization of atomic variables.</li>
</ul>

<p>Existing customers will get the new version as a free upgrade, but
  the rest of you can get a <strong>50% discount if you subscribe to
  my blog by email</strong>. Just fill in your name and email address
  in the form below and be sure to click the confirmation link. You'll
  then receive future blog posts by email, along with an announcement
  and exclusive discount for the FCD edition
  of <code><a href="http://www.stdthread.co.uk">just::thread</a></code>
  when it's released.</p>

<p>If you're reading this via RSS and your reader doesn't show you the
  form or doesn't allow you to submit your details, then please go to
  the <a href="http://www.justsoftwaresolutions.co.uk/news/just-thread-fcd-discount.html#subscriptionform">web
    version of this blog entry</a>.</p>

<p>If you've already subscribed by email then you don't need to
  subscribe again, you'll automatically receive the discount code.</p>

  <a name="subscriptionform"></a>

<!-- AWeber Web Form Generator 3.0 -->
<form method="post" class="af-form-wrapper"
      action="http://www.aweber.com/scripts/addlead.pl"
      style="padding:1em; border:1px solid black">
<div style="display: none;">
<input type="hidden" name="meta_web_form_id" value="1011135726" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="jssblog" />
<input type="hidden" name="redirect" value="http://www.aweber.com/thankyou-coi.htm?m=text" id="redirect_b02a2c2d57481294a119c00efe906b59" />

<input type="hidden" name="meta_adtracking" value="Blog_signup_form" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="name,email" />
<input type="hidden" name="meta_forward_vars" value="" />
<input type="hidden" name="meta_tooltip" value="" />
</div>
<p>Please sign me up to receive blog posts by email and <strong>an
    exclusive discount on <code><a href="http://www.stdthread.co.uk">just::thread</a></code></strong>.</p>
<div id="af-body-81011135726" class="af-body af-standards">
<div class="af-element">
<label class="previewLabel" for="awf_field-1607387">Name: </label>
<div class="af-textWrap">
<input id="awf_field-1607387" type="text" name="name" class="text" value=""  />
</div>
<div class="af-clear"></div></div>
<div class="af-element">
<label class="previewLabel" for="awf_field-1607388">Email: </label>
<div class="af-textWrap"><input class="text" id="awf_field-1607388" type="text" name="email" value=""  />
</div><div class="af-clear"></div>
</div>
<div class="af-element buttonContainer">
<input name="submit" class="submit" type="submit" value="Subscribe me"/>
<div class="af-clear"></div>
</div>
<div class="af-element privacyPolicy" style="text-align: center"><p><a href="http://www.aweber.com/permission.htm" target="_blank">We respect your email privacy</a></p>
<div class="af-clear"></div>
</div>
</div>
<img src="http://forms.aweber.com/form/displays.htm?id=jAyMjIzMrOxMbA==" border="0" />
</form>
<script type="text/javascript">
    (function() {
        var IE = /*@cc_on!@*/false;
        if (!IE) { return; }
        if (document.compatMode && document.compatMode == "BackCompat") {
            if (document.getElementById("af-form-81011135726")) {
                document.getElementById("af-form-81011135726").className = "af-form af-quirksMode";
            }
            if (document.getElementById("af-body-81011135726")) {
                document.getElementById("af-body-81011135726").className = "af-body inline af-quirksMode";
            }
            if (document.getElementById("af-header-81011135726")) {
                document.getElementById("af-header-81011135726").className = "af-header af-quirksMode";
            }
            if (document.getElementById("af-footer-81011135726")) {
                document.getElementById("af-footer-81011135726").className = "af-footer af-quirksMode";
            }
        }
    })();
</script>

<!-- /AWeber Web Form Generator 3.0 -->
<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-fcd-discount.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/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/just::thread" rel="tag">just::thread</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fnews%2Fjust-thread-fcd-discount.html&amp;title=Sign%20up%20for%20a%2050%25%20discount%20just%3A%3Athread%20FCD%20edition"> 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-fcd-discount.html&amp;title=Sign%20up%20for%20a%2050%25%20discount%20just%3A%3Athread%20FCD%20edition">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-fcd-discount.html&amp;title=Sign%20up%20for%20a%2050%25%20discount%20just%3A%3Athread%20FCD%20edition">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-fcd-discount.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>C++0x Final Committee Draft Published - Please Comment</title><link>http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html</guid><pubDate>Fri, 02 Apr 2010 11:42:35 +0100</pubDate><description><![CDATA[
<p>Earlier this week,
  the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf">Final
  Committee Draft (FCD) of the C++0x standard</a> was published. This
  means that C++0x is now in the final stages of bug fixing and
  wordsmithing before publication. If all goes to plan, the draft will
  move to Final Draft International Standard (FDIS) early in 2011, and
  will be a new standard by the end of 2011.</p>

<p>The publication of the FCD means that the draft standard has now
  been officially put up for review by the national standards bodies
  of ISO's member countries. The British Standards Institution is one
  of several national bodies that is actively involved in the
  standardisation of the C++ language.  The panel members of the C++
  Committee of the BSI, IST 5/-/21, are currently compiling a list of
  comments on the FCD.  We intend to submit these as the BSI's
  National Body comments, aimed at getting issues with the FCD
  addressed before it becomes the new international standard for C++.</p>

<p>We're welcoming additional comments, and would like to provide a
  channel for anyone who may be interested in the C++0x Standard, but
  not able to be fully involved in the standards process, to submit
  comments. Note that not all comments &mdash; regardless of whether
  they are submitted by panel members or non-members &mdash; will go
  forward.</p>

<p>Here is some guidance on what we are looking for:</p>

<ul>
  <li>Suggestions for how to improve the clarity of the wording, even
    if that's just by adding a cross-reference to a relevant paragraph
    elsewhere;</li>

  <li>Comments that identify any under/over specification; and</li>

  <li>Comments highlighting inconsistencies or contradictions in the
    draft text.</li>
</ul>

<p>Comments should be specific and preferably should include suggested
  updated wording (and if you need help formulating updated wording we
  can provide it, within reason) &mdash; the C++ standards committee
  is working to a very tight schedule in order to get C++0x out as
  soon as possible, and comments without wording (which therefore
  require more work from the committee) are more likely to be
  rejected.</p>

<p><strong>The time for adding/removing features has now passed, so
    comments should focus on improving the draft as it stands rather
    than suggesting new features.</strong></p>

<p>Owing to the time scale for submission to BSI and ISO, comments
  need to be submitted by Friday 18th June 2010.</p>

<p>If you have any comments, feel free
    to <a href="http://www.justsoftwaresolutions.co.uk/cplusplus/c++0x-now-at-fcd.html#makecomment">post
    them in the comment section</a> of this blog entry,
    or <a href="mailto:bsi@justsoftwaresolutions.co.uk">email them to
    me</a>. I will forward all appropriate suggestions to the rest of
    the BSI panel (whether or not I agree with them).</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/c++0x-now-at-fcd.html">permanent link</a></i><br> <small> Tags:  <a href="http://technorati.com/tag/C++" rel="tag">C++</a>,  <a href="http://technorati.com/tag/C++0x" rel="tag">C++0x</a>,  <a href="http://technorati.com/tag/WG21" rel="tag">WG21</a>,  <a href="http://technorati.com/tag/FCD" rel="tag">FCD</a> <br>  <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.justsoftwaresolutions.co.uk%2Fcplusplus%2Fc%2B%2B0x-now-at-fcd.html&amp;title=C%2B%2B0x%20Final%20Committee%20Draft%20Published%20-%20Please%20Comment"> 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%2Fc%2B%2B0x-now-at-fcd.html&amp;title=C%2B%2B0x%20Final%20Committee%20Draft%20Published%20-%20Please%20Comment">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%2Fc%2B%2B0x-now-at-fcd.html&amp;title=C%2B%2B0x%20Final%20Committee%20Draft%20Published%20-%20Please%20Comment">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/c++0x-now-at-fcd.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.2 Released</title><link>http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3.2_released.html</link><author>Anthony Williams</author><guid isPermaLink="true">http://www.justsoftwaresolutions.co.uk/news/just_thread_c++0x_thread_library_v1.3.2_released.html</guid><pubDate>Thu, 25 Mar 2010 17:16:21 +0000</pubDate><description><![CDATA[
<p>I am pleased to announce that version 1.3.2 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 Microsoft Visual
Studio 2010 RC for both 32-bit and 64-bit Windows.</p>

<p>There are also a few minor fixes to the future classes, and a new
implementation of mutexes and condition variables on linux with lower
overhead.</p>

<strong><a href="http://www.stdthread.co.uk/order.html">Purchase your
copy</a> and get started with the C++0x thread library NOW.</strong></p>

<p>As usual, existing customers are entitled to a free upgrade to V1.3.2
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.2_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.2_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3.2%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.2_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3.2%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.2_released.html&amp;title=just%3A%3Athread%20C%2B%2B0x%20Thread%20Library%20V1.3.2%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.2_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></channel></rss>