[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Doug Currie <doug.currie@...>
- Date: Wed, 6 Jan 2010 18:25:15 -0500
On Jan 6, 2010, at 12:03 PM, Roberto Ierusalimschy wrote:
> In C, it is not difficult to use the thread itself as a key to store
> per-thread data in the registry, if necessary.
Also, see Lua Gems chapter 1 on per-thread local storage using the function environment LUA_ENVIRONINDEX. A unique function environment is shared among all C functions in a library, and per-thread storage is placed there in a table weak-keyed by thread. This saves a trip to the registry, and keeps the data private to the library.
e
- References:
- Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy