[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: select implementation for a "file descriptor set"
- From: Diego Nehab <diego@...>
- Date: Tue, 5 Aug 2003 15:24:38 -0400 (EDT)
> This is tricky on Windows... certainly you can wait for multiple
> objects such as file I/O, serial, sockets etc; but not with a
> select(), which is only valid for sockets. This is one area of
> Windows that's a real PITA; the lack of a single signal/messaging
> system for timers, UI events, sockets, asyc I/O, semaphores etc...
> they all have different mechanisms.
Yes, this is why I didn't include a generic select in LuaSocket. I could
even add support for select on Lua file objects but that would only work
on Linux. I might do that in the future.
BTW, in case you are wondering how the Cygwin people implemented select
on Windows... At each call, they actually sort all "file desctiptors"
according to category (socket, file, handle to other stuff etc), spawn
one thread to wait on each category and then combine the results. This
is *not* an option for LuaSocket.