[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What's the difference between a "coroutine" and a "thread" in Lua?
- From: David Kastrup <dak@...>
- Date: Tue, 14 Aug 2007 12:20:10 +0200
Hugo Etchegoyen <hetchegoyen@hasar.com> writes:
> If I understood well, then one might say that resuming is like
> calling and yielding is like returning, the only difference being
> that the callee keeps the values of its local variables between
> invocations, and each time it is called it starts executing at the
> instruction following the last yield. Right?
And it keeps its whole call stack, too. You can yield in the middle
of a called function. Just like the caller (so coroutines are an
emancipation of subroutines, but there remain subtle differences).
Basically right.
--
David Kastrup
- References:
- RE: What's the difference between a "coroutine" and a "thread" in Lua?, Jerome Vuarand
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, Adrien de Croy
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, David Kastrup
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, Adrien de Croy
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, David Kastrup
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, Hugo Etchegoyen
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, David Kastrup
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, Gregg Reynolds
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, David Kastrup
- Re: What's the difference between a "coroutine" and a "thread" in Lua?, Hugo Etchegoyen