Some time ago, SL Baur wrote...
It is not unreasonable to
have file descriptors that are read outside of XEmacs main logic. It
is also not unreasonable to allow them to be added to select(2) file
descriptor masks. Under Unix, we use select loops, either via Xt, or
via a home-brewed version when running tty-only. Does a similar
functionality exist under MS-Windows?
Yes. A function MsgWaitForMultipleObjects, which is the core of XEmacs
event loop under MS Windows, waits for either a message arriving or a
handle becoming "signaled". The latter is a catch, because not all the
handles can be used for synchronization[1]. The worst miss is that pipes
cannot. Although, I coded special kinds of lstreams which are used to
pull and push data through pipes and sockets in a separate thread and
signal a handle when they are done, so this is doable.
Big K
[1] For example, serial ports and sockets can be used for synchronization,
real files can be accessed asynchronously and signal when R/W done only
under NT, named pipes in NT only alike, and anonymous pipes never signal
at all.