The behavior of select(...) is to wake up when at least one watched descriptor is "ready".
Pthreads take it easy with a single condition variable to pthread_cond_wait
.
Windows has WaitForMultipleEvents(...) which allows to sleep pretty much on everything. It will wake up when at least one event is triggered but it is possible to require all events to be triggered.
clWaitForEvents returns CL_SUCCESS if the execution status of all events in event_list is CL_COMPLETE. Whoops. This explains a bug report I had some time ago.
I am in the process of implementing the event callback system to allow wait on a single event which will be triggered by the first event reaching CL_COMPLETE. Leaving aside I must do that with care, I wonder why there's no such thing as clWaitForAnyEvent.