On 2010-5-6 1:39, John Labenski wrote: > On Tue, May 4, 2010 at 9:43 AM, Chunlin Zhang<zhangchun...@gmail.com> wrote: >> If I want to do some mutithread programming,how can I do using wxlua in >> pure lua? > > You can use Lua's coroutines, see the sample coroutine.wx.lua or more > generally Google for sample code using Lua coroutines. wxThread will > be added in the 2.9 release of wxLua, which may be in a few months. Lua's coroutines can not solve my problem I think.
My situation is that I have several thread(I use luatask,because coroutine I think it is not suitable here) to communicate with rs232 port,and when some data was send to wxlua main thread. At first I did not know how to receive data from other thread in main thread,so I thought I can new a wxthread to wait the data from other thread and then send event to wxlua main thread. Now I use the way that main thread handle the "wxEVT_IDLE",in this event handle I try to receive data.And it works > > You can also see some coroutine usage in the program gpeddler2, it was > written for a very old version of wxLua so it might not run out of the > box, but wxLua hasn't changed too much. It at least might give you > some ideas. > > http://www.erix.it/progutil/gpeddler2/help/gpeddler2.html > > Regards, > John > > ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users