249 posts
Location
In the universe
Posted 10 October 2012 - 10:49 PM
Can I have two coroutines working at the same time?
521 posts
Location
Stockholm, Sweden
Posted 10 October 2012 - 11:08 PM
What is a coroutines? Or do you just mean programs?
8543 posts
Posted 10 October 2012 - 11:20 PM
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.
249 posts
Location
In the universe
Posted 10 October 2012 - 11:23 PM
ok, but how can I do that?
8543 posts
Posted 10 October 2012 - 11:25 PM
parallel.waitForAny(functionOne, functionTwo)
Check out the documentation on the wiki.