RE: [boost] 2. It is unavoidable to use threads

Carlo Wood <carlo@alinoe.com> wrote: <snip>
No, I am confused. You do as if it trivial. But where is the answer to my question? How can I implement an interface that allows one to wait for events on 100 sockets, a timer, a few named pipes, a fifo and some large diskfile I/O at the same time? Is your answer WaitForMultipleObjects ? Then 1) what about the limit of 64?
That limit may well be a problem. (As may the limit on the size of an FD_SET on POSIX systems with nothing better than select().)
And 2) How can I use that to wait for events on SOCKET's? The only thing I can find for that is WSAWaitForMultipleEvents. But obviously you can call WSAWaitForMultipleEvents *and* ^ not, presumably
WaitForMultipleObjects at the same time (without using threads).
The WSAEVENT type alias and associated functions appear to have been defined as an attempt to allow for implementation on other operating systems; in reality a WSAEVENT is a HANDLE to a Win32 event and you can use it with WaitForMultipleObjects (this is documented in the Platform SDK).
participants (1)
-
Ben Hutchings