Motivated by the Pattern-Oriented Software Architecture for Concurrent and Networked Software MOOC (https://class.coursera.org/posa-001/class/index).
In case of using c++11, the command is:
$ g++ -std=c++11 -pthread your_file.cpp -o your_program
Need to be linked to pthread library as asked here:
http://stackoverflow.com/questions/13227526/c11-thread-not-working
http://stackoverflow.com/questions/10395936/how-to-make-cdt-eclipse-work-with-c11-threads
C++11 on Ubuntu (actually boost::thread should be OK)
http://stackoverflow.com/questions/8403722/installing-c11-compiler-on-ubuntu
http://stackoverflow.com/questions/10363646/compiling-c11-with-g
http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/
C++11:
http://stackoverflow.com/questions/218786/concurrent-programming-c
http://www.baptiste-wicht.com/series/cpp11-concurrency-tutorial/
How to use boost thread:
http://antonym.org/2009/05/threading-with-boost---part-i-creating-threads.html
http://www.codeproject.com/Articles/279053/How-to-get-started-using-Boost-threads
http://stackoverflow.com/questions/415994/boost-thread-tutorials
Herb Sutter's articles: