145 posts
Location
the vast cosmos of my mind; binary!
Posted 03 December 2012 - 08:41 PM
could someone please explain to me what a coroutne is i keep hearing about it but i don't know what the heck it is
1243 posts
Location
Indiana, United States
Posted 04 December 2012 - 05:57 AM
As I understand it, it's just multiple threads being used on a program. That way you can run, say, recent.receive() and a while true do loop at the same time.
66 posts
Posted 04 December 2012 - 06:11 AM
Coroutines are objects that allow you to form multiple tasks at the same time.
However, only use coroutines when you believe you have no other choice, because many issues can occur with coroutines
HowTo use? please consult the wiki
2217 posts
Location
3232235883
Posted 04 December 2012 - 06:36 AM
coroutines are not multithreading in the sense of running things at the same time
they just halt a segment of code and run it again
the parallel api gives the illusion of multithreading but it just resumes functions in order
see
teh manual