lua-users home
lua-l archive

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


Hi,

Roberto Ierusalimschy wrote:
> (Maybe we will add a "reset" call to clear the
> thread after an error...)

Yes, please. And please make this a spec requirement for thread
reuse even in case of proper termination (although not enforced
by the implementation).

[
With the latest Coco patches threads are _not_ reusable, even
after proper thread termination. I assumed this was "undefined"
by the language spec and so didn't bother to add a (tricky)
workaround. A lua_clearthread() (calling luai_userstateclear())
would simplify this.
]

BTW: Another one for the wishlist: lua_cleartable(L, narr, nrec).
Use case: a common table referenced in dozens of upvalues needs
to be cleared fast. Replacing it with a new table is not an
option because then I'd have to store all affected closures
somewhere. Iterative clearing is annoying/slow. Don't know if
this is a popular wish, though.

Bye,
     Mike