lua-users home
lua-l archive

Question about multi-threading in Lua

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


Hi,

I am working on an application that connects to a server through TCP/IP socket and listen for events continuously. When a certain event is picked up, the application should performance some tasks.

What I want to do is to use Lua socket to listen for the events and then create a new thread each time a particular event type is received.

I found that there are two ways to do it, one is using coroutine and the other one is to install Lua Thread.

It seems like they are very similar but I don't quite understand when it is better to us coroutine or LuaThread.

Could someone give me some suggestions?

Thanks,
Pete

AltStyle によって変換されたページ (->オリジナル) /