lua-users home
lua-l archive

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


Take a look at http://lua-users.org/wiki/MultiTasking

I have been using https://github.com/LuaLanes/lanes (and also https://github.com/sonoro1234/luajit-async for LuaJIT only)
On 04/06/2021 8:03 AM Judith" <luobinjuan@qq.com> wrote:


Hi! I'm Judith!

Recently, I have been studying Lua's multithreading, and found that Lua only has the concept of collaboration. 
As my Lua will call OC function, I want to set timeout when Lua calls OC method, so as to achieve the following two effects:
1.  When timeout arrives first, stop OC method,
2.  When OC method finishes first, stop the Timer, 

I can't let OC method and timer run at the same time, Lua can't achieve concurrence, Dear, do you have it Is there any other way to achieve this function? I would be appreciate much!