lua-users home
lua-l archive

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

On Friday 04 March 2005 1:35 am, Peter Colson wrote:
> - Is LuaThreads a separate package or is it the coroutines facility
> within standard
> Lua for doing non-pre-emptive threading in a Lua script? Does it sit on
> top
> of Posix threads (saw references to LuaThreads on top of eCos threads
> elsewhere)?

LuaThreads is an addition to the Lua Core.  unfortunately, it can't be 
packaged as a loadable module, it has to be compiled into the core.

It handles preemptive threads using Posix threads, it also works in windows, 
using a small adapter library (included) to make them look like posix.

> - I can see a lua_newthread() API that can be called from C - is this an
> alternative to creating my own Posix thread and then lua_open()'ing a
> new
> Lua VM within that thread (which was what I was trying to do now)?

no, that lua_newthread() creates a lua 'thread' value.  i think it's the basic 
value that holds state, used to create coroutines.  it gets confusing because 
of the name, but it's a different thing.


Attachment: pgp7tdUnKXU8p.pgp
Description: PGP signature