Can I have two coroutines working at the same time?
[QUESTION] [LUA] Coroutines
Started by anonimo182, Oct 10 2012 09:49 PM
4 replies to this topic
#1
Posted 10 October 2012 - 09:49 PM
#2
Posted 10 October 2012 - 10:08 PM
What is a coroutines? Or do you just mean programs?
#3
Posted 10 October 2012 - 10:20 PM
anonimo182, on 10 October 2012 - 09:49 PM, said:
Can I have two coroutines working at the same time?
Technically, no. But you can run one and then the other, back and forth, in rapid succession. They will appear to be running at the same time. This is what the parallel API does (you pass it two functions to create the coroutines with), so that would be a good place to start.
#4
Posted 10 October 2012 - 10:23 PM
ok, but how can I do that?
#5
Posted 10 October 2012 - 10:25 PM
parallel.waitForAny(functionOne, functionTwo)
Check out the documentation on the wiki.
Check out the documentation on the wiki.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











