lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

As for mixing with HelperThreads, it is completely orthogonal to what I
am suggesting. Although LuaSocket is not completely thread-safe, it can
be made so with just a little work.

I see that HelperThreads can, e.g., take a Lua file handle (FILE *)
and use it in a non-blocking way using threads. This is something a
Windows IOCP library couldn't do.

Right, but if a thread blocks on a call that chooses never to return,
the thread is dead, right?

I note that the libevent API is based on (fd and timeval) callbacks,
whereas IOCP is based on polling (GetQueuedCompletionStatus). I.e.,
the dispatcher is built outside library in my IOCP approach, whereas
it is inside the library in libevent. Which approach do you prefer?

Can't you use WaitForMultipleObjects with an associated condition or
something like that instead of polling?

Regards,
Diego.