lua-users home
lua-l archive

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


On Wed, Aug 5, 2009 at 10:36 AM, Cosmin
Apreutesei<cosmin.apreutesei@gmail.com> wrote:
> Another solution would be to keep the callbacks into FIFO list and
> have lua pull them from there

that's what i did for my Helper Threads Toolkit
(http://luaforge.net/projects/helper-threads/).  feel free to use
whatever code you want from there.

in fact, my 'grand vision' for that project had two parts:

1:- a generic asynchrounous Lua API. (the front end)

2:- make it easy to write asynchronous bindings to C libraries. (the back end)

to make 2 possible, i resorted to the helper threads trick, since most
interesting C libraries aren't asynchronous by nature; but in theory,
if your C library is really async, you should be able to use some of
the back end API and get the front end 'for free'

if you're interested in the idea, i can dig the code to help somewhat
better, since i really don't remember how 'threading independent' the
code resulted in the end.

-- 
Javier