[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LibEvent binding to Lua? Mix w/ HelperThreads?
- From: Daniel Quintela <dq@...>
- Date: Fri, 31 Mar 2006 20:02:47 -0300
Wim Couwenberg and D Burgess comments about Events lib and Win32:
Diego Nehab escribió:
Yeah, this is what I noticed from the sources too. Is your IOCP library
compatible to libevent?
No. Libevent API is dependent on (struct timeval) and (fd) and more;
it expects (fd)s to work a la UNIX. That was too big an impedance
mismatch for me to bother accommodating.
It may be possible to make a lua wrapper that creates a common API
between libevent and a Windows IOCP library, but the abstraction would
have to be carefully designed to avoid these UNIXisms.
I believe we need some C support. I was thinking about creating a
layer in C that implements a libevent-like dispatch loop but that
uses opaque descriptors. Those could be fds on UNIX or HANDLEs on
We would also have to adapt Lua's file I/O functions and LuaSocket
functions to integrate well with this abstraction layer.