Just Software Solutions

Published Articles and Committee Papers

Here is a list of articles and other publications written by one of our directors, Anthony Williams. In each case, the title is linked to the online version. Anthony's conference presentations are available here.

Book

Anthony is the author of C++ Concurrency in Action, published by Manning, which provides a comprehensive tutorial and reference to the multithreading support in C++11, C++14, C++17 and the Concurrency TS.

It's not just the best current treatment of C++11's threading facilities ... it's likely to remain the best for some time to come. Scott Meyers

The second edition is now in print. Get your copy now.

Interviews

Anthony was also interviewed for CppCast for their 17th October 2015 episode.

Articles

Issue / Publication DatePublicationTitleDescription
April 2016Overload 132 Using enum classes as bitfields This article is a slightly expanded version of my blog entry: Using enum classes as bitfields.
August 2015Overload 128 Numbers in Javascript This article is a slightly expanded version of my blog entry: Numbers in Javascript.
October 2011Overload 105 Picking patterns for parallel programs A description of design patterns for parallel programs, and some guidance on when each is useful.
September 2010DrDobbs.com Concept Checking Without Concepts in C++ One of the important features of the now-defunct C++0x Concepts proposal was the ability to overload functions based on whether or not their arguments met certain concepts. This article describes a way to allow that for concepts based on the presence of particular member functions.
May 2010DrDobbs.com Enforcing Correct Mutex Usage with Synchronized Values This article expands on the SynchronizedValue<T> template I mentioned in my presentation on Concurrency in the Real World at ACCU 2010, and deals with the problem of ensuring that the mutex associated with some data is locked whenever the data is accessed.
April 2010DrDobbs.com Simple Concurrency with Dataflow Variables in C++ Dataflow variables are write-once read-many variables with in-built synchronization. In this article I explain how they can be used to write scalable code with no race conditions, and how to implement them in C++.
October 2009Overload 93 Multi-threading in C++0x An overview of the new multithreading facilities in C++0x.
September 2009DevX.com Avoiding the Perils of C++0x Data Races Race conditions are one of the biggest causes of problems in multithreaded code. This article takes a brief look at some of the ways in which race conditions can occur. There is also sample code that demonstrates the perils of data races by showing how even simple code with a data race can lead to corrupt data.
May 2009DevX.com Introduction to Variadic Templates in C++0x This article introduces the new variadic template facility from C++0x, which allows you to write templates that take a variable number of template arguments.
November 2008Dr. Dobb's Journal What's New in Boost Threads? This article gives an overview of the new features added to the Boost thread library in the recent releases.
September 2008Codeguru.com Deadlock: The problem and a solution This is an excerpt from Anthony's book C++ Concurrency in Action, and describes the problem of deadlock and ways to avoid it.
August 2008DevX.com Simpler Multithreading in C++0x Part of DevX.com's Special Report on C++0x, this article provides a whistle-stop tour of the new C++0x multithreading support.
August 2008Overload 86 Exceptions make for Elegant Code This article is a slightly expanded version of my blog entry: Exceptions make for Elegant Code.
April 2008Dr. Dobb's Journal Optimizing Math-intensive Applications with Fixed Point Arithmetic This article describes the fixed-point techniques used to vastly improve the performance of an application using sines, cosines and exponentials without hardware floating point support.
The source code referenced in the article can be downloaded from here. It is released under the Boost Software License.
April 2007Overload 78 Implementing Synchronization Primitives for Boost on Windows Platforms This article describes the techniques involved in writing a new mutex implementation for Windows.
June 2006CVu 18.3 Building on a Legacy This article discusses ways of handling legacy code, and how to work so that maintenance gets easier rather than harder.
June 2006Overload 73 Implementing drop-down menus in pure CSS (no JavaScript) This article describes the details behind implementing drop-down menus with CSS in a cross-browser fashion.
May 2006Dr. Dobb's Journal Message Handling Without Dependencies This article describes a type-safe technique for passing messages around an application in C++, without requiring extensive coupling between the producer and consumer
April 2004CVu 16.2 Writing Maintainable Code A brief summary of techniques to help you write maintainable code.
November 2003C/C++ Users Journal Strong Exception-Safe Storage This article describes the use of a double-buffer technique to provide the Strong Exception Safety Guarantee without the use of dynamic memory, even when the underlying data only provides the Basic Exception Safety Guarantee.
April 2003Overload 54 EXPR_TYPE — An Implementation of typeof Using Current Standard C++ (PDF) typeof is a much-sought-after facility that is lacking from current C++; it is the ability to declare a variable to have the same type as the result of a given expression, or make a function have the same type as an expression. The general idea is that typeof(some-expression) would be usable anywhere a type name could normally be used. This article describes a way of providing this ability within the realms of current C++. There is code to accompany this article.
October 2002Overload 51 Pairing Off Iterators (PDF) This article describes the implementation of an iterator adaptor that converts a pair of ranges into a range of pairs, so that two containers can be sorted by a key held in only one of them, for example. The code is available for download
October 2001Overload 45 Introduction to C++ Templates (PDF) This is a brief introduction to C++ templates - how they work, how to use them, and how to write your own.
August 2001Overload 44 Flexible Functors and Binders (PDF) This article describes a set of binders to assist writing programs using the Functional Programming style, and a set of adaptors for other functors, such as pointers-to-functions and pointers-to-member-functions, to enable them to be integrated seamlessly. The code to accompany the article can be downloaded.
April 2001Overload 42 A Generic Non-Intrusive Smart Pointer Implementation (PDF) This article describes the implementation of a smart pointer that can be freely converted to and from a raw pointer, or other types of smart pointer, without losing its reference count. It also permits the use of arrays, and the use of dynamic_cast. The code to accompany the article can be downloaded. There is an erratum for this article.

C++ Standards Committee Papers

Issue / Publication DatePublicationTitleDescription
March 2019C++ Standards Committee Mailing P0660R9: Stop Tokens and a Joining Thread, Rev 9 A replacement for std::thread that always joins, and "stop" tokens to allow cooperative interruption.
January 2019C++ Standards Committee Mailing P0660R8: Stop Tokens and a Joining Thread, Rev 8 A replacement for std::thread that always joins, and "stop" tokens to allow cooperative interruption.
November 2018C++ Standards Committee Mailing P0660R7: Interrupt Tokens and a Joining Thread, Rev 7 A replacement for std::thread that always joins, and cancellation tokens to allow cooperative interruption.
November 2018C++ Standards Committee Mailing P0660R6: A Cooperatively Interruptible Joining Thread, Rev 6 A replacement for std::thread that always joins, and allows interruption.
October 2018C++ Standards Committee Mailing P0660R5: A Cooperatively Interruptible Joining Thread, Rev 5 A replacement for std::thread that always joins, and allows interruption.
September 2018C++ Standards Committee Mailing P0660R4: A Cooperatively Interruptible Joining Thread, Rev 4 A replacement for std::thread that always joins, and allows interruption.
June 2018C++ Standards Committee Mailing P0660R3: A Cooperatively Interruptible Joining Thread, Rev 3 A replacement for std::thread that always joins, and allows interruption.
May 2018C++ Standards Committee Mailing P0660R2: A Cooperatively Interruptible Joining Thread, Rev 2 A replacement for std::thread that always joins, and allows interruption.
March 2017C++ Standards Committee Mailing P0623R0: Final C++17 Parallel Algorithms Fixes Apply final changes to the parallel algorithms for C++17.
March 2017C++ Standards Committee Mailing P0574R1: Algorithm Complexity Constraints and Parallel Overloads A revision of P0547R0 based on feedback from SG1 and LWG
March 2017C++ Standards Committee Mailing P0290R2: apply() for synchronized_value<T> A revision of P0290R1 to allow coexistence with apply for std::tuple
February 2017C++ Standards Committee Mailing P0574R0: Algorithm Complexity Constraints and Parallel Overloads Modifications to the C++17 draft to better specify the complexity constraints of parallel algorithms to allow efficient implementations.
October 2016C++ Standards Committee Mailing P0290R1: apply() for synchronized_value<T> Revision of P0290R0 based on feedback from SG1
March 2016C++ Standards Committee Mailing P0290R0: apply() for synchronized_value<T> A revision of N4032; all operations on the value wrapped in a synchronized_value<T> are now down through a separate apply function.
November 2015C++ Standards Committee Mailing P0158R0: Couroutines belong in a TS BSI position paper advocating coroutines being in a TS rather than moved straight to the standard.
April 2015C++ Standards Committee Mailing P0120R0: constexpr unions and common initial sequences A proposal to allow accessing common initial sequences of structs in constexpr unions, the same as allowed for non-constexpr unions, in order to allow more space-efficient variant implementations.
April 2015C++ Standards Committee Mailing P0110R0: Implementing the strong guarantee for variant<> assignment Description of the difficulties in implementing the strong guarantee for std::variant, with techniques on how to do it, and the requirements on the types for the various options.
May 2014C++ Standards Committee Mailing N4033: synchronized_value<T> for associating a mutex with a value synchronized_value<T> wraps a mutex and a value so you cannot access the value without locking the mutex
May 2014C++ Standards Committee Mailing N4032: Comments on continuations and executors My comments on the executors proposal for the Concurrency TS
November 2010C++ Standards Committee Mailing N3197: Lockable requirements for C++0x A revision of N3130
August 2010C++ Standards Committee Mailing N3131: Compile-time rational arithmetic and overflow Document the handling of overflow in std::ratio operations
August 2010C++ Standards Committee Mailing N3130: Lockable requirements for C++0x This paper revises the wording for the C++0x draft for mutexes to gather together common requirements
February 2010C++ Standards Committee Mailing N3038: Managing the lifetime of thread_local variables with contexts (Revision 2) A revision of N2959, adding support for nested contexts
September 2009C++ Standards Committee Mailing N2959: Managing the lifetime of thread_local variables with contexts (Revision 1) This is a revision of my earlier paper, N2907 which expands my proposal for a thread_local_context class, along with full proposed wording. I think this provides a workable solution to the general problem of ensuring that destructors for thread_local variables are run at particular points in the execution of a program as discussed in N2880.
September 2009C++ Standards Committee Mailing N2967: Issues on Futures 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 N2888 in with changes requested by the LWG at July's meeting (including the addition of a new future type — atomic_future which serializes all operations), and editorial comments on the earlier wording. It doesn't resolve everything — there is still some discussion over whether unique_future::get() should return a value or a reference, for example — but it provides a sound basis for further discussion.
June 2009C++ Standards Committee Mailing N2907: Managing the lifetime of thread_local variables with contexts This paper introduces the idea of a thread_local_context which manages the lifetime of variables declared thread_local. In particular, this concept is introduced to manage the interaction of thread_local variables with detached threads and asynchronous function calls.
June 2009C++ Standards Committee Mailing N2888: Moving Futures - Proposed Wording for UK comments 335, 336, 337 and 338 This paper provides rationale and proposed wording for the UK comments on the C++ working draft requesting move semantics for std::unique_future and std::shared_future.
July 2008C++ Standards Committee Mailing N2709: Packaging Tasks for Asynchronous Execution This paper proposes a revised version of packaged_task following its removal from N2671.
June 2008C++ Standards Committee Post-Sophia Antipolis Mailing N2671: An Asynchronous Future Value Proposed Wording Jointly authored with Deltef Vollmann and Howard Hinnant. An updated version of N2627 with proposed wording. packaged_task has been removed for a later proposal.
May 2008C++ Standards Committee Pre-Sophia Antipolis Mailing N2627: An Asynchronous Future Value (Revised) Jointly authored with Deltef Vollmann and Howard Hinnant. An updated version of N2561.
March 2008C++ Standards Committee Post-Bellevue Mailing N2561: An Asynchronous Future Value Jointly authored with Deltef Vollmann and Howard Hinnant. Futures, promises and packaged tasks for multi-threaded programming. See Futures and Tasks in C++0x for a summary.
September 2007C++ Standards Committee Pre-Kona Mailing Names, Linkage and Templates (Rev 2) (PDF) This paper is an update to the earlier proposals for making local types usable with templates (N1945 and N2187), with revised wording.
June 2007C++ Standards Committee Pre-Toronto Mailing Multi-threading library for Standard C++ This paper (jointly authored with Howard Hinnant, Beman Dawes, Lawrence Crowl and Jeff Garland) proposes a set of classes for a basic thread library for C++, including thread launching, mutexes and condition variables.
May 2007C++ Standards Committee Post-Oxford Mailing Thread Pools and Futures This paper proposes new classes to the C++ Standard Library for thread pools and futures, to build on top of the new threading facilities.
March 2007C++ Standards Committee Pre-Oxford Mailing Names, Linkage and Templates (rev 1) (PDF) This paper is an update to the earlier proposal for making local types usable with templates (N1945), with revised examples, motiviation and wording.
November 2006C++ Standards Committee Post-Portland Mailing Thoughts on a Thread Library for C++ This paper outlines thoughts on various aspects of a thread library for C++, including one-time initialization, and general thread synchronization.
February 2006C++ Standards Committee Pre-Berlin Mailing Names, Linkage and Templates (PDF) This paper proposes that the C++ Standard is changed, so that unnamed and local types have linkage, in order to simplify the language and make these types usable with templates.
March 2003C++ Standards Committee Pre-Oxford Mailing Making Local Classes more Useful (PDF) This paper proposes a couple of small changes to the C++ Standard: to allow local classes to work with templates, and to allow local classes to declare friend functions.

Design and Content Copyright © 2005-2024 Just Software Solutions Ltd. All rights reserved. | Privacy Policy