lua-users home
lua-l archive

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

That is quite an interesting thread, though I'd like to come back to a
point that has been discarded too quickly in my opinion.

2008/6/19 Javier Guerra <>:
> An obvious improvement might be to use finer locks, maybe one per
> mutable object; but a pthread mutex lock weights between 40 and 64
> bytes each.  way too much.  readers/writer locks are even bigger.

In some applications (mine at the very least), a 40 to 64 bytes
overhead per mutable object would be very acceptable. Did someone
already try to patch Lua source code to have per-object locks ?

Also if implemented like the default Lua global lock mechanism (ie.
with macros), it could be a good basis to experiment with custom locks
(1bit per object), hashed locks, or a combination of both.