Lua Multi thread concurrence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua Multi thread concurrence

Judith"
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!
Reply | Threaded
Open this post in threaded view
|

Re: Lua Multi thread concurrence

Victor Bombi

On 04/06/2021 8:03 AM Judith" <[hidden email]> 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!