lua-users home
lua-l archive

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


在 2015/4/30 16:03, 云风 写道:
2015-04-30 15:48 GMT+08:00 Victor Bombi <sonoro@telefonica.net>:
I am a LuaLanes fanatic.
Did you know? : https://github.com/LuaLanes/lanes
I read the description from http://lua-users.org/wiki/MultiTasking before.

The main idea of ltask is a M:N schedule , but the lua lanes is one
lua states per thread . It's the main difference .
So you can create large number tasks (may be  thousands)  in ltask,
the schedule and the message channels may be a little more efficient
:)


I had a glimpse of the code. I like the idea of M:N schedule.

I see the ``select, send, recv`` functions mimics the sockets, but
only in a non-blocking style. is there a plan to add some blocking
synchonization mechanism (e.g. call `yield` inside send or recv)?


I also noticed your packing/unpacking (or serialization/deserialization)
code have limitations on the data structure. I would like it to have support
for, at least, Lua functions with no (explicit) upvalues and tables having
entries refered to same object.
or, maybe you could take use of some existing serialization modules.


one last thought is the single schedule struct might hurt the scalability.
I see read-write lock is used to protect the shared queue.
if this code is to be used in very large parallel systems, I'd suggest some
lock free algorithms.

--
the nerdy Peng / 书呆彭 / Sent from Thunderbird