What is the equivalent linux API for WaitForMultipleObjects () and WSAEnumNetworkEvents ()?

What is the equivalent linux API for WaitForMultipleObjects () and WSAEnumNetworkEvents ()? Can we use pthread_cond_wait () for WaitForMultipleObjects?

+4
source share
2 answers

There is no simple API on Linux, which is equivalent to WaitForMultipleObjects() .

This QnA contains the answer to the first part and perhaps the best explanation.

For WSAEnumNetworkEvents() on linux, use poll() or select() according to your requirements. Another libevent application libevent also be useful.

Link:

+3
source

For developers coming from the Windows background, we faced the same problem when porting code from Win32 to pthreads and created an open source (MIT-licensed) pevents library that implements WaitForMultipleObjects() on Linux, supporting both automatic and manual reset events. It should behave just like WIN32 events in Windows.

+3
source

All Articles