lua-users home
lua-l archive

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


> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On Behalf Of zhiguo zhao
> Sent: Saturday, December 25, 2010 4:13 PM
> To: Lua mailing list
> Subject: named lanes linda like lanes.linda('name') need

> merry christmas to lanes author(s) and all luaer.

> Now linda must be pass as arg from main lua to child lanes threads.
> I think when use string not function to start child lanes thread with lanes.gen, need named linda, that is  lanes.linda('name')  will return same linda object if pass same 
> same name.

> named linda and unamed linda just link named shared memory or unmaed shared memory.

If you need to pass some values (including a linda) to a lane generated from a string, you can pass everything you need in the lanes's global space:

local task_launch= lanes.gen( "", { globals={GlobalLinda=some_linda} }, task )

Then the lane can reference GlobalLinda.

Benoit.