'Working with threads in c/c++, across many different platforms

In my understanding, if you use C, then you are bound to use POSIX Threads.

These are OS dependent, and if you use Linux, you have to use <pthread.h>, while if you use Windows, you have to go with <windows.h>.

These things are transferable to C++ as well.

However, if you use C++ and specifically a version after C++11, then you can skip the POSIX threads method, and use #include <thread> and you are off to go.

Is this a correct understanding? Is there something i miss?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source