lua-users home
lua-l archive

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


On Tue, Mar 27, 2012 at 3:10 PM, Luís Santos <jasonsantos@gmail.com> wrote:
> My current preferred design for such things is to create a userdata
> with the event queues and have lua poll it and dispatch.

There is a fairly elegant way to do this with the Windows API,
actually.  There are APCs (Asynchronous Procedure Calls) which can be
queued on the main thread, which is sleeping with SleepEx().  This
will return if anything is in the queue, and then we go back to sleep.

So that will be the next experiment; all Lua code running on one
thread.  But Peng Zhicheng mentions the debug hook method, which could
fit into this scheme.  Only one way to find out!

Multithreading is hard, as Barbie the Software Engineer says ....

steve d.