[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: "Gregg Reynolds" <dev@...>
- Date: Fri, 10 Aug 2007 14:42:41 -0500
On 8/10/07, David Given <dg@cowlark.com> wrote:
>
> Just out of interest, under what situations would one use a Lua thread (usual
> terminology from the manual), *without* having it also be a coroutine?
I'm not sure; but see http://www.cs.princeton.edu/~diego/professional/luathread/
Which illustrates the confusion. A "LuaThread" is not a "lua thread".
Now suppose the developers decide in the future that it would be a
Good Thing to expose a true thread api as part of the language.
Doesn't seem likely, in light of
http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/hopl.pdf: "we did not (and
still do not) believe in the standard multithreading model, which is
preemptive concurrency with shared memory: we still think that no one
can write correct programs in a language where 'a=a+1' is
notdeterministic." But who's counting? "thread" is already taken; I
don't know if one could make it mean "kernel thread" without breakage.
In any case, the point is the current documentation tickles the
Principal of Least Surprise, by assigning a local meaning to a
well-known term. Not that big of a deal, but we have evidence that
this is a source of confusion.
-g