lua-users home
lua-l archive

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


Hi,

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.

The problem being I can't seem to find any libraries that are able to do this.

I've tried combining lua lanes with lua sockets, which fails because of the 'deep' data
from lua sockets.  I was working on trying to handle deep data using
luaG_newdeepuserdata(L, idfunc) in lua sockets meth_accept function, but i'm currently
getting nothing really but segfaults which I can't seem to diagnose why:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6820700 (LWP 19896)]
0x000000000041057c in luaH_get ()
(gdb) bt
#0  0x000000000041057c in luaH_get ()
#1  0x0000000000410ca7 in luaH_set ()
#2  0x0000000000406961 in lua_rawset ()
#3  0x00007ffff6c69915 in populate_func_lookup_table (L=0x653d40, _i=-1, 
    name_=0x7ffff6c70cbc "set_finalizer") at tools.c:530
#4  0x00007ffff6c648ed in lane_main (vs=0x667b40) at lanes.c:2055

I've looked at luv - based on libuv, however this doesn't appear to support threading.

If anyones got any suggestions, I'd be most appreciative!

Thanks

Chris