It's simply a thread, provided by Lua in order to do multithreading.
In Bully, we have
CreateThread function that works pretty much like
coroutine. But,
CreateThread function does not provide any information about status of the thread itself, so we don't know exactly as if the thread is already dead or not. Unless you made a continuous running function or inconstant variable that changes every run in the loop just to check the thread status.
On the other hand,
coroutine has
coroutine.status function which returns a state of coroutine (unlike
CreateThread). But,
coroutine function does not run independently as
CreateThread function does, which means you also need a bigger space to operate that thing.
However, this explanation is just a simple logic comparation between
CreateThread and
Coroutines. I personally use
coroutine function just for making infinite loop of "
potential crash infinite loop", so it can restart once it crashed. What if i was pretty sure it won't crash? then i would prefer to use
CreateThread instead.