lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Benjohn Barnes wrote:
> 
> Is there any difference between coroutines and co-operative threads?

They are basically the same.  Add a scheduler to coroutines and you
get co-operative threads.

Ciao, ET.

PS: That's how I explain coroutines: "Think of them as minimalistic
threads without a scheduler.  Because there's no scheduler you have
to explicitely say which 'thread' (coroutine) should run next."
Everything else comes automatically from this definition (i.e. can
a coroutine terminate?  How to delete one.  Can it "return"?  ...).