lua-users home
lua-l archive

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


> I'm looking for a way in which to spawn a pre-emptive thread (e.g. pthread)
> for each TCP connection, in both lua and luajit.

Look at my library: https://github.com/tnodir/luasys
There are examples in test folder.

You can use thread.runvm() to start independent OS thread of LuaState
or thread.run() for cooperative OS thread inside Lua State.

There is scheduler to run coroutines on top of pool of OS threads inside Lua State.
OS threads used for blocking system calls.

-- Nodir