Jerry's Tutorials: Boost Threads and Condition Variables for C++ Programming

Jerry's Tutorials: Boost Threads and Condition Variables for C++ Programming


Over and above the std library that comes built in with C++, boost is the premier library of useful functions and data structures for C++ programming.  I only use a few of the boost routines in my programming, but the ones I do use are very important for my projects.  Far and away, the most important boost routines that I use are a part of boost::thread.

boost::thread provides support for multiple threads.  Basic programming with boost::thread is quite easy, but some of the more advanced features are a little trickier.  In particular, creating programs with multiple threads that can serialize critical portions of the code is quite easy.  But if the threads need to signal to each other, it is necessary to use condition variables.

I find that signaling with condition variables is much more complicated and confusing than is the basic use of threads and serialization.  Therefore, I decided to create a little tutorial on the use of condition variables.  However, in order to create a tutorial on condition variables, I have to go back and give some of the basics on threads themselves.



Return to Jerry's Home Page

This page last edited on 26 Mar 2016.