Suppose I have two programs where some sections of the code of one program file depend on the some sections of other program. How can I make sure that the dependency is executed properly. I mean dependent section of one program does not execute faster than the section of other program which depends on the first program's section...
For general thread you can (and should) use C++11 threads. Unfortunately C++11 does not support name mutexes.
This means you can use C++11 to synchronize threads of same process but not threads across processes. For that you have to rely on pthreads or Windows API.