695 posts
Location
In my basement.
Posted 06 May 2013 - 05:17 AM
Hi there! I've seen many topics and stuff using coroutines.
What are they? Can someone please explain in detail..
Thanks.
//Mackan90096
515 posts
Location
Australia
Posted 06 May 2013 - 05:27 AM
http://lua-users.org/wiki/CoroutinesTutorialGenerally you would want to stick with parallel.waitForAny or parallel.waitForAll. There are plenty of tutorials on this in the tutorials section. I would link you to some but I'm on my phone at the moment and it's quite a hassle.
7508 posts
Location
Australia
Posted 06 May 2013 - 05:40 AM
As 1lann stated most times you will just want to stick with the parallel api as it is managed coroutines, you don't need to know how they work, you just request them to work.
Also just a slight change to the opening line of that link 1lann posted, coroutines actually cannot allow us to do multiple things at the same time, it may seem to the user that it is at the same time, but actually only one coroutine is running at any given time, and it must yield in order for the next to run… in CC that is where os.pullEvent's come in, they call coroutine.yield.
1511 posts
Location
Pennsylvania
Posted 06 May 2013 - 07:28 AM
Cranium asked about coroutines. Go check out that post, they are thoroughly explained there.
2217 posts
Location
3232235883
Posted 06 May 2013 - 02:27 PM
coroutines are a bit advanced, if you want basic multitasking use the parallel API:
http://www.computerc...l-parallel-api/