I don't really get the difference between semaphores and condition variables...
What can be used with threads and what can't, when should I use what?
I don't really get the difference between semaphores and condition variables...
What can be used with threads and what can't, when should I use what?
In windows semaphores are used for inter-process thread synchronization. Whereas, on the other hand condition variable can only be used for thread synchronization in a process. Visit this link for information on some thread synchronization techniques used in windows:
http://www.codeproject.com/Articles/7953/Thread-Synchronization-for-Beginners
Also, condition variables are atomic in nature. If you are a windows programmer, you can use critical sections for thread synchronization in a process.