Linux/pthreads equivalents for Windows API functions
Posted on 2005-04-10
I am developing a cross-platform thread library for use with a card game server that I am designing. I am familar with programming threads in Java and Windows API. I would like to implement a synchronization construct similar to Windows event handles (HANDLE CreateEvent(...) in Windows API or Object.wait() / Object.notify() in Java). However, the examples I have seen for "condition variables" (if that is the equivalent) are confusing to me. I do not understand the need to associate the additional mutex with the condition variable.
Once the condition is signaled, when does it get reset? Is there any way to affect when they get reset?
Also, is there any pthreads equivalent for ::WaitForMultipleObjects(...) ? If not, any ideas on implementing something similar?