Tim Bailey

C++ Threading

Technical Report, 2010


 


Description

This report was written as a resource for a series of postgraduate seminars on C++ software design (originally delivered in April 2010). It demonstrates how to write multi-threaded code that is as easy to implement, debug and maintain as single-threaded code. The focus is not the threading API (eg., pthreads, Boost.thread, or C++11 std::thread) but on higher level threading patterns, which include:
  • The Monitor object for non-intrusive internal locking.
  • The Accessor object for enforcing external locking.
  • Threadsafe channels for message-passing communication between threads.
  • Proxies for enforcing correct send-receive access to channel endpoints.


Download

Slides [pdf] (56 kb, 14 pages)
Source code [zip] (7 kb)



[Tim's Homepage]