[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_lock
- From: lhf (Luiz Henrique de Figueiredo)
- Date: Fri, 14 Nov 1997 12:50:02 -0200
>From Mark@nlcc.demon.co.uk Fri Nov 14 12:47:31 1997
>In message <9711131905.AA12546@exu.inf.puc-rio.br> email@example.com writes:
> > The Lua reference mechanism (Section 5.6 of the manual) has an
> > option that allows C to keep a reference to a Lua object without preventing
> > the GC to collect the object. Does anyone use this option? It was supposed
> > to be useful in breaking 'reference cicles', when C keeps a reference to a
> > Lua object and Lua keeps a reference to the C object (userdata), and then they
> > would be never collected. But we are not sure whether anyone ever succeed in
> > using it...
>Am I right in thinking that you are *not* proposing deletion of the lua_ref
>mechanism, whereby a host program can create tables for it's own use, protect
>them from the GC and hide them from Lua, whilst still exploiting lua_*
>functions to do associative lookups within them? I do this a lot.
We're *not* proposing deletion of the lua_ref mechanism.
What we want to know is if anyone uses ref's *without locking them*.
The application you mention is *exactly* what the lua_ref mechanism was designed
for -- in you case, you lock the values to protect them for GC.
So, does anyone use unlocked references?