C++ does not have any threading facilities embedded in the language. It relies on some API or library implementing threading. It could be a particular OS API, or the library implementing some OS abstraction layer, that is, applicable to many OS. Here, you have some choice. One of the library is special because it is standardized. This is the
C++ Standard Library:
http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library[
^],
http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library#Thread_support_library[
^].
Note that threading types have been introduced only with C++11:
http://en.wikipedia.org/wiki/C%2B%2B11[
^].
You can find some code samples in many places. For example:
http://stackoverflow.com/questions/266168/simple-example-of-threading-in-c[
^].
If you use anything older than that, you have many options: OS-specific APIs (I would advise you always tag your platform(s) in you questions), and many alternatives, such as boost:
http://en.wikipedia.org/wiki/Boost_library[
^],
http://www.boost.org[
^].
Boost also has its implementation of standard C++11 library, as well as Apache, for example. See the second link above for further information.
—SA