lua-users home
lua-l archive

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


It occurred to me that LuaTask (in which each LuaTask gets its own Lua 
state in a new thread) might be a handy way of writing simple threaded 
servers. However, only number and string objects can be passed in messages 
between tasks.

I was wondering:

1. Is there any reliable way to pass an accept()ed LuaSocket object from 
one LuaTask to another? Can userdata be serialised?

2. If so (and assuming that socket is only ever manipulated in the task to 
which it's passed), is it safe to pass this sort of data between tasks? Is 
LuaSocket itself thread-safe?

Has anyone used LuaTask for handling multiple threads which communicate 
using multiple blocking sockets?