Thread Proposals Being Considered for C++

WG14 N1162
Bill Seymour
2006-02-28

WG21’s Evolution Working Group is currently considering threads. There are three more or less competing proposals that WG14 might be interested in.
  • It is believed that threads cannot be implemented correctly without at least some compiler support (Hans Boehm, Threads Cannot be Implemented as a Library), so Lawrence Crowl suggests in WG21 N1874 and N1875 a language-based solution with new keywords taken from the implementor namespace.

  • One library-based proposal is the open-source Boost Threads Library, commercial versions of which are currently being shipped by both Freescale and Dinkumware. The Dinkumware implementation has a C interface described at the end of WG21 N1907; and it’s this C interface that might be of interest to WG14.

  • There is also sentiment, but no formal paper, for “that subset of POSIX threads that can be implemented widely.” As of this writing, it’s not clear how large that subset would be. The problem is a common belief that Pthreads cannot be implemented efficiently on one popular platform.

In addition to those three, Hans Boehm, Doug Lea and Bill Pugh propose in WG21 N1777 and N1876 a memory model and a lock-free atomics library to support a larger threads library.

Boehm, Lea and Pugh also contributed a paper, WG14 N1131, that was in our pre-Mont-Tremblant mailing; and Boehm has links to a number of informative papers and the beginnings of a FAQ at http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/.

As this is clearly an area in which C/C++ compatibility is absolutely essential, WG21’s Evolution Working Group welcomes input from WG14; and Bill Seymour has offered to take to the Evolution Working Group in Berlin any discussion and straw poll results that WG14 wish to provide.