lua-users home
lua-l archive

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


On Thu, Jun 19, 2008 at 2:32 AM, Diego Nehab <diego@tecgraf.puc-rio.br> wrote:
> Is something in between enough? Perhaps a mechamism allowing
> threads to create tables that are not accessible from other
> threads (an error could be raised if unauthorized access
> attempted), and a thread-safe way to move such tables from
> one thread to the other?

some 'in between' ideas i've came by, but didn't seem to coalesce:

- very small locks (1 bit?) not using pthreads, but our own locking primitives.

- 'hashed locks': instead of one lock per data structure, get a hash
of the pointer and use it to pick one of a fixed number of locks.
hash collitions would share the same lock, but should be rare enough.

- low-level proxy values, that refer to the real value on other Lua
Space.  even if you have to block to access 'remote' data, it could be
faster than copying it, and easier than serialising
closures/coroutines/etc.

- copy on write between Lua Spaces.... this is very hazy, but still a
recurring meme.

-- 
Javier