lua-users home
lua-l archive

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


"J. Perkins" wrote:
> 
> I don't think C-level coroutine support is a good idea, myself. Programs
> that need it should (IMO of course) use a separate C library.

That's why they only made the lua_newthread function.  Lua itself will
only support having multiple threads.  Basically it's nothing real new.
The difference between multiple threads created by lua_open and
lua_newthread is only that the newthread ones share the same global
state.

How you use this new function is up to you.  You can use your favorite C
library to implement coroutines (unfortunately there's no standard lib) or
preemptive threads or even something completely different.  You choice...

Ciao, ET.