lua-users home
lua-l archive

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


On Wed, Aug 5, 2009 at 5:36 PM, Cosmin
Apreutesei<cosmin.apreutesei@gmail.com> wrote:
> I have a library in which I can register asynchronous callbacks.
> Problem is, I can't call Lua inside the callback because the state is
> not consistent (obviously).

Seems to be a common problem. On Windows, I 'recoupled' to the main
thread by sending messages to a custom window, on GTK+ I used the
async io mechanism for the same thing.  But it keeps coming up;  I had
to solve a similar problem with a little Copas server by making a
thread read from stdin and getting it to write to a socket.  Didn't
feel like the most elegant way to do things! So yes, I'm also
interested in a more general solution to the problem.

steve d.